Hi Pedro, > Thanks! This is definitely the way to go. My pleasure :). > > + If CLOSE_LDINFO_FD is nonzero, then this routine also closes > > + the ldinfo_fd file descriptor. This is useful when the ldinfo > > + data is obtained via ptrace, as ptrace opens a file descriptor > > + for each and every entry; but we cannot use this descriptor > > + as the consumer of the XML library list might live in a different > > + process. */ > > How interesting. So AIX's list is better than glibc in that we > could use that descriptor to avoid the "library file gdb opens is > no longer the same as the inferior opened" issue. True. Now, if only we could send the "fd" across processes :-). > > +struct ld_info > > +{ > > + int next; > > I'm surprised this is signed. > It was unsigned on Ulrich's version: http://sourceware.org/ml/gdb-patches/2007-05/msg00321.html Right you are. I read sys/ldr.h pretty carefully, and was convinced that they had defined it as an int, but not so. For the record: ============================================================================== | Field Name | __ld_info32 size;type(s)| __ld_info64 size; type(s) | |============================================================================| | ldinfo_next | 4; uint | 4; uint | | ldinfo_flags | n/a | 4; uint | | ldinfo_fd | 4; int | 4; int | | ldinfo_fp | 4; struct file * / uint | 4; struct file * / uint | | ldinfo_core | 4; int / int | 8; long long / long | | ldinfo_textorg | 4; void * / uint | 8; unsigned long long / void * | | ldinfo_textsize | 4; int | 8; long long / long | | ldinfo_dataorg | 4; void * / uint | 8; unsigned long long / void * | | ldinfo_datasize | 4; int | 8; long long / long | | ldinfo_filename | variable | variable | ============================================================================== > Anyway, I skimmed it and it looked good to me. Thanks! I made the following adjustments to my patch making "next" unsigned... | diff --git a/gdb/rs6000-aix-tdep.c b/gdb/rs6000-aix-tdep.c | index 450abae..9956eb3 100644 | --- a/gdb/rs6000-aix-tdep.c | +++ b/gdb/rs6000-aix-tdep.c | @@ -854,7 +854,7 @@ static const struct ld_info_desc ld_info64_desc = | | struct ld_info | { | - int next; | + ULONGEST next; | int fd; | CORE_ADDR textorg; | ULONGEST textsize; | @@ -882,9 +882,9 @@ rs6000_aix_extract_ld_info (struct gdbarch *gdbarch, | = tdep->wordsize == 8 ? ld_info64_desc : ld_info32_desc; | struct ld_info info; | | - info.next = extract_signed_integer (ldi_buf + desc.ldinfo_next.offset, | - desc.ldinfo_next.size, | - byte_order); | + info.next = extract_unsigned_integer (ldi_buf + desc.ldinfo_next.offset, | + desc.ldinfo_next.size, | + byte_order); | info.fd = extract_signed_integer (ldi_buf + desc.ldinfo_fd.offset, | desc.ldinfo_fd.size, | byte_order); ... and checked the patch in. For the record, attached is the patch I checked in. Thanks for the quick review! -- Joel