| Norman Black 2005-04-22, 6:00 pm |
| I am porting my debugger, which is part of a Modula-2 language system, from
other Unix systems (Solaris, Linux) or AIX. I only have to support AIX 5.2 a
later. I notice that AIX has the /proc filesystem which Solaris has so I can
use that code for AIX. I also found the AIX thread debugging library and
have adjusted to that.
What I have not found is how the debugger determines when a shared object is
loaded/unloaded and therefore what shared objects are currently loaded. On
Solaris and Linux, both ELF systems, the mechanism is ELF based where I get
an address to set a breakpoint in the dynamic loader and when the breakpoint
is hit you read the loader linked list of objects loaded. I have found
nothing with regards to this on AIX. The only thing I think I can do is read
the /proc/pid/map and /proc/pid/object items to get shared objects that are
loaded and then hopefully find out what system calls are related to shared
object load and unload and use the /proc control mechanisms to trap on exit
of these system calls. Then read the list of loaded shared objects a
determine what is new and therefore loaded and what is missing and therefore
unloaded.
Norman
Saperion Inc.
|