diff options
author | Tom Tromey <tromey@adacore.com> | 2023-03-03 10:29:06 -0700 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2023-04-21 07:13:45 -0600 |
commit | 532d55c0ab4bda1d5da90c6301c7d28ddd98ad18 (patch) | |
tree | 0d1accde94c6c7a390aceb3a604593444f6a5285 /gdb/dwarf2 | |
parent | 32c8e7265a55ab4cf14fa255115a81134c62fb16 (diff) | |
download | fsf-binutils-gdb-532d55c0ab4bda1d5da90c6301c7d28ddd98ad18.zip fsf-binutils-gdb-532d55c0ab4bda1d5da90c6301c7d28ddd98ad18.tar.gz fsf-binutils-gdb-532d55c0ab4bda1d5da90c6301c7d28ddd98ad18.tar.bz2 |
Handle function descriptors in call_site_target
call_site_target::iterate_over_addresses may look up a minimal symbol.
On platforms like PPC64 that use function descriptors, this may find
an unexpected address. The fix is to use gdbarch_convert_from_func_ptr_addr
to convert from a function descriptor to the address recorded at the
call site.
I've added a new test case that is based on the internal AdaCore test
that provoked this bug. However, I'm unable to test it as-is on
PPC64.
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r-- | gdb/dwarf2/loc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c index 914e016..d961587 100644 --- a/gdb/dwarf2/loc.c +++ b/gdb/dwarf2/loc.c @@ -711,7 +711,11 @@ call_site_target::iterate_over_addresses : msym.minsym->print_name ())); } - callback (msym.value_address ()); + + CORE_ADDR addr = (gdbarch_convert_from_func_ptr_addr + (call_site_gdbarch, msym.value_address (), + current_inferior ()->top_target ())); + callback (addr); } break; |