I want to do remote debugging on 10.6.2 system. I found the following link about remote kernel debugging. I tried using the default kernel, rather than building my own and use mach_kernel in the debug kit. However, when I issue attach <ip> command in the gdb, remote_connect keeps timing out. The boot-args on the target contains debug=0xd44.
Ideally I do not need any changes to the kernel itself. I really want to single-step through some initialization code in my kext. However, I also tried building the kernel per the instructions. However, I could not find Libstreams package in the oepnsource. When I try to build the cctools-750 package, I get following errors:
../lto.c:8:24: error: llvm-c/lto.h: No such file or directory
../lto.c:21: error: expected declaration specifiers or ‘...’ before ‘*’ token
../lto.c:21: warning: type defaults to ‘int’ in declaration of ‘lto_module_t’
../lto.c:21: error: ‘lto_module_t’ declared as function returning a function
../lto.c:21: error: function ‘lto_module_t’ is initialized like a variable
../lto.c:25: error: expected declaration specifiers or ‘...’ before ‘*’ token
../lto.c:25: warning: type defaults to ‘int’ in declaration of ‘lto_symbol_attributes’
../lto.c:25: error: ‘lto_symbol_attributes’ declared as function returning a function
../lto.c:25: error: function ‘lto_symbol_attributes’ is initialized like a variable
../lto.c: In function ‘is_llvm_bitcode’:
../lto.c:96: error: ‘lto_create’ undeclared (first use in this function)
../lto.c:96: error: (Each undeclared identifier is reported only once
../lto.c:96: error: for each function it appears in.)
../lto.c:101: error: ‘lto_get_sym_attr’ undeclared (first use in this function)
../lto.c:120: warning: implicit declaration of function ‘lto_create’
../lto.c:120: warning: assignment makes pointer from integer without a cast
../lto.c: In function ‘lto_toc_symbol’:
../lto.c:226: warning: statement with no effect
../lto.c:226: error: expected ‘;’ before ‘attr’
../lto.c:228: error: ‘attr’ undeclared (first use in this function)
../lto.c:228: warning: implicit declaration of function ‘lto_get_sym_attr’
../lto.c:229: error: ‘LTO_SYMBOL_SCOPE_MASK’ undeclared (first use in this function)
../lto.c:229: error: ‘LTO_SYMBOL_SCOPE_INTERNAL’ undeclared (first use in this function)
../lto.c:232: error: ‘LTO_SYMBOL_DEFINITION_MASK’ undeclared (first use in this function)
../lto.c:233: error: ‘LTO_SYMBOL_DEFINITION_REGULAR’ undeclared (first use in this function)
../lto.c:235: error: ‘LTO_SYMBOL_DEFINITION_WEAK’ undeclared (first use in this function)
../lto.c:238: error: ‘LTO_SYMBOL_DEFINITION_TENTATIVE’ undeclared (first use in this function)
../lto.c: In function ‘lto_get_nlist_64’:
../lto.c:256: warning: statement with no effect
../lto.c:256: error: expected ‘;’ before ‘attr’
../lto.c:259: error: ‘attr’ undeclared (first use in this function)
../lto.c:261: error: ‘LTO_SYMBOL_SCOPE_MASK’ undeclared (first use in this function)
../lto.c:262: error: ‘LTO_SYMBOL_SCOPE_INTERNAL’ undeclared (first use in this function)
../lto.c:264: error: ‘LTO_SYMBOL_SCOPE_HIDDEN’ undeclared (first use in this function)
../lto.c:268: error: ‘LTO_SYMBOL_SCOPE_DEFAULT’ undeclared (first use in this function)
../lto.c:272: error: ‘LTO_SYMBOL_DEFINITION_MASK’ undeclared (first use in this function)
../lto.c:272: error: ‘LTO_SYMBOL_DEFINITION_WEAK’ undeclared (first use in this function)
../lto.c:276: error: ‘LTO_SYMBOL_DEFINITION_TENTATIVE’ undeclared (first use in this function)
../lto.c:282: error: ‘LTO_SYMBOL_DEFINITION_UNDEFINED’ undeclared (first use in this function)
../lto.c:287: error: ‘LTO_SYMBOL_PERMISSIONS_MASK’ undeclared (first use in this function)
../lto.c:288: error: ‘LTO_SYMBOL_PERMISSIONS_CODE’ undeclared (first use in this function)
../lto.c:292: error: ‘LTO_SYMBOL_PERMISSIONS_DATA’ undeclared (first use in this function)
../lto.c:296: error: ‘LTO_SYMBOL_PERMISSIONS_RODATA’ undeclared (first use in this function)
make[2]: *** [lto.o] Error 1
make[1]: *** [static] Error 2
make: *** [all] Error 1
Any help is greatly appreciated. Thanks!