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
I would suggest that you could go download the source for gdb as used by the Development Tools.
But, well, I've read that source and I'm not sure that telling anyone to go read it is a productive suggestion.
In any case, you will want to use the various mach APIs to do this. In particular, the APIs are found in /usr/include/mach/*.h. Specifically, you'll want to start with task_for_pid() and work your way down to the info you need.
Note that task_for_pid() (and any other mechanism used to grub through another tasks innards) requires either admin access or membership in the development group on the machine.