From 532d55c0ab4bda1d5da90c6301c7d28ddd98ad18 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 3 Mar 2023 10:29:06 -0700 Subject: 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. --- gdb/dwarf2/loc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gdb/dwarf2') 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; -- cgit v1.1