title: Gdbserver for Snow Leopard?
body: <p>So I have this source <a href="https://opensource.apple.com/tarballs/gdb/gdb-1515.tar.gz" rel="nofollow noreferrer">gdb-1515</a>. I'm using Xcode 3.2.6 command line tools on Snow Leopard (and this gdb source is the source of the gdb included in them).</p>
  
  <p>Trying to run (inside <code>/private/var/root/Downloads/gdb-1515/src/gdb/gdbserver</code>):</p>
  
  <pre><code>gcc -I. -I. -I./../regformats -I./../macosx -I./../../include -I../../bfd -I./../../bfd -I/private/var/root/Downloads/gdb-1515/src/bfd ./../macosx/macosx-nat.c
  </code></pre>
  
  <p>Fails with:</p>
  
  <pre><code>./../macosx/macosx-nat.c:34:17: error: bfd.h: No such file or directory
  ./../macosx/macosx-nat.c:35:18: error: defs.h: No such file or directory
  ./../macosx/macosx-nat.c:36:21: error: gdbcore.h: No such file or directory
  ./../macosx/macosx-nat.c:37:20: error: serial.h: No such file or directory
  ./../macosx/macosx-nat.c:38:22: error: ser-base.h: No such file or directory
  ./../macosx/macosx-nat.c:39:22: error: ser-unix.h: No such file or directory
  ./../macosx/macosx-nat.c:40:22: error: inferior.h: No such file or directory
  ./../macosx/macosx-nat.c:41:23: error: objc-lang.h: No such file or directory
  ./../macosx/macosx-nat.c:42:21: error: infcall.h: No such file or directory
  In file included from ./../macosx/macosx-nat-dyld.h:5,
  </code></pre>
  
  <p>Etc.</p>
  
  <p>Thing is there is no <code>bfd.h</code> anywhere inside the <code>gdb-1515</code> folder.</p>
  
  <pre><code>find /private/var/root/Downloads/gdb-1515 -name bfd.h
  </code></pre>
  
  <p>Returns no output.</p>
  
  <p>I want to call <code>attach_to_classic_process</code> (defined inside <code>macosx/macosx-nat.c</code>) from <code>gdbserver/macosx_low.c:476</code> instead of ptrace - that's why I'm trying to build <code>macosx/macosx-nat.c</code> from the <code>gdbserver</code> directory.</p>
  
  <p>Currently at its place it's used ptrace which fails for rosetta processes.</p>
  
  <p><em>Ok so I want to debug a classic (Rosetta) process running on Snow Leopard by using remote gdb connection. 
  It should be obvious cause after all Rosetta applications are using remote connection for debugging anyway.
  Additionally gdb application can successfully connect with mentioned PowerPC applications.
  I'm trying to compile gdbserver from this <a href="https://opensource.apple.com/tarballs/gdb/gdb-1515.tar.gz" rel="nofollow noreferrer">apple source</a> however this is Aids - it seems that the way gdbserver included in this packages is fundamentally wrong since the original gdb is using special functions to establish connection to classic process while gdbserver is trying to use ptrace which obviously fails.
  Another thing that comes into my mind is why the hell gdbserver has to be so retardedly complicated - why isn't directly co-operating with the functional gdb command line application (maybe a wrapper of sorts)?</em></p>