This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 24700]
Daniel Jacobowitz <drow@false.org> writes:
> That doesn't have anything to do with my question :-) find_pc_section
> does the PC -> section mapping pretty much the way the new code you've
> duplicated does it.
The original implementation of ppc64_linux_convert_from_func_ptr_addr
actually used find_pc_section. It was changed to use
target_section_by_addr a few years ago:
2003-10-24 Andrew Cagney <cagney@redhat.com>
* target.c: Include "gdbcore.h".
(get_target_memory, get_target_memory_unsigned): New functions.
* target.h (get_target_memory, get_target_memory_unsigned): Declare.
* ppc-linux-tdep.c (ppc64_linux_convert_from_func_ptr_addr):
Use get_target_memory_unsigned.
* Makefile.in (target.o): Update dependencies.
None of these implementations can handle all cases satisfactory. I also
tried a combination of both, but it wasn't any better either. There are
basically two problems: one is that gdb is often trying to convert a
function pointer that was already converted, the other one is that the
conversion is done both on unrelocated and relocated objects.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."