So I have this source gdb-1515. 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).
Trying to run (inside /private/var/root/Downloads/gdb-1515/src/gdb/gdbserver):
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
Fails with:
./../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,
Etc.
Thing is there is no bfd.h anywhere inside the gdb-1515 folder.
find /private/var/root/Downloads/gdb-1515 -name bfd.h
Returns no output.
I want to call attach_to_classic_process (defined inside macosx/macosx-nat.c) from gdbserver/macosx_low.c:476 instead of ptrace - that's why I'm trying to build macosx/macosx-nat.c from the gdbserver directory.
Currently at its place it's used ptrace which fails for rosetta processes.
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 apple source 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)?