[PATCH RFA] procfs.c related changes for AIX 5
Tue Mar 6 01:29:00 GMT 2001
On Mar 6, 11:07am, Eli Zaretskii wrote:
> On Mon, 5 Mar 2001, Kevin Buettner wrote:
> > 2) AIX5 does not have a static set of syscalls. Consequently, there
> > is no sys/syscall.h file which provides a nice mapping of
> > symbolic names to syscall numbers. Instead, AIX5 provides
> > /proc/PID/sysent which contains the information necessary to map
> > strings to syscall numbers.
> > These syscall numbers are guaranteed (at least according to the
> > developer that I spoke with) to be fixed for the lifetime of a
> > process, but they can certainly vary between processes.
> Won't this cause problems with debugging syscall-related code, since
> the values for GDB and the debuggee may be different?
GDB knows the pid of the debuggee and interogates its syscall
numbers in /proc/PID/sysent. I.e, it gets the syscall numbers
for the child process that it's debugging from the /proc filesystem.
If you're asking about actually debugging code that contains syscalls,
I'm not sure I see how this enters the picture. Does GDB have some
additional knowledge of syscall numbers somewhere that I'm not aware
BTW, for a given release of the OS, I think there is a subset of the
syscall numbers that'll be fixed and won't change. So, in theory,
it'd be possible to use a table of #defines for these, but to the best
of my knowledge, IBM hasn't provided any in their header files.
> > The changes needed to the code due to this change were fairly
> > significant:
> > a) sysset_t data structures (or data structures which contain
> > sysset_t) must be dynamically allocated. They must be
> > copied with memcpy() and explicitly freed when no longer
> > needed.
> > b) Comparisons against SYS_* constants no longer work. I've
> > introduced a number of predicate functions (such as
> > syscall_is_exit()) which will indicate whether a
> > given system call number is a particular system call. All code
> > which formerly relied on comparisons against a system call
> > number was rewritten to call one of these new predicate
> > functions instead.
> Shouldn't these be documented somehow in gdbint.texinfo?
Probably. (I'll take a look.)
More information about the Gdb-patches