This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] print minimal symbol's address correctly...


As it turns out, AIX was using the same technique as ia64 to identify
function descriptors (namely: If the address doesn't point to an
executable section, then it must be a function descriptor). See:

   http://www.sourceware.org/ml/gdb-patches/2008-05/msg00740.html

for a description of why this heuristic needs to be improved a bit.

For now, I applied the same change as on ia64. The comment above
the function doing the conversion mentions OPD sections, but it
doesn't apply at all to the actual implementation, and I couldn't
find confirmation of such sections in the few AIX documents that
I have. Perhaps Ulrich could confirm or infirm whether the comment
is accurate? Depending on the outcome, we might want to further
enhance the function.

2008-06-01  Joel Brobecker  <brobecker@adacore.com>

        * rs6000-aix-tdep.c (rs6000_convert_from_func_ptr_addr): Do not
        treat pointers in data space as function descriptors if the
        target address is also in the data space.

Tested on ppc-aix. One test actually transitions from PASS to FAIL,
but I think the PASS was an accident: It's ptype.exp:ptype int.
For some reason, when doing "ptype v_int" (v_int is a global variable
defined as an int), GDB doesn't seem to find any debugging info for
this variable (it should because the file was compiled with -g!).
Because of that, and because rs6000_convert_from_func_ptr_addr used
to treat the address as a function descriptor, GDB would end up
thinking that this is a function pointer, and thus return "type =
int ()". This output satisfies the test because it matches "int.*",
but it's actually not correct.  Now, it prints "<data variable, no
debug info>", which is actually more appropriate for the situation.

Checked in.

-- 
Joel

Attachment: aix.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]