What I\'m trying to do I feel is pretty straightforward, I\'m just not sure exactly how to do it.
Specifically I just want to get a list of modules (shared/dynamic l
There's some existing BSD-licensed code you can take from the Breakpad project that does exactly this:
dyld provides some hooks for GDB, notably a well-known function symbol that gdb can use to get access to a struct that contains this info. See http://www.opensource.apple.com/source/dyld/dyld-132.13/include/mach-o/dyld_images.h You can see how GDB does it here: http://www.opensource.apple.com/source/gdb/gdb-1344/src/gdb/macosx/macosx-nat-dyld.c (look for "macosx_init_addresses"). The internals of lookup_minimal_symbol are too horrible to talk about, but Breakpad's implementation is fairly straightforward.