[RFA 3/6] Make PSYMBOL_VALUE_ADDRESS take objfile argument

Keith Seitz keiths@redhat.com
Fri Jun 1 20:06:00 GMT 2018


On 05/03/2018 03:36 PM, Tom Tromey wrote:
>
> Note that the macro doesn't actually perform any relocation -- it uses
> the argument, to ensure that any possible syntax errors are caught,
> but it multiplies it by 0 so that it has no effect.

Just a word of warning: ANOFFSET will assert if PSYMBOL_SECTION is -1. [Setting that field isn't added until the last patch.] As a result, I am seeing a lot of temporary regressions. I build with -O0, so maybe these won't show up during a buildbot test run?

Example from gdb.base/reread.exp:

run
Starting program: /home/keiths/work/gdb/branches/tromey-psymbols-progspace.patch
/linux/gdb/testsuite/outputs/gdb.base/reread/reread
../../src/gdb/psymtab.c:493: internal-error: Section index is uninitialized
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) FAIL: gdb.base/reread.exp: opts= "-fPIE" "ldflags=-pie" : run to foo() (GDB internal error)
Resyncing due to internal error.

> ChangeLog
> 2018-05-03  Tom Tromey  <tromey@redhat.com>
> 
> 	* psympriv.h (SET_PSYMBOL_VALUE_ADDRESS)
> 	(PSYMBOL_VALUE_RAW_ADDRESS): New macros.
> 	(PSYMBOL_VALUE_ADDRESS): Add 'objfile' parameter.
> 	* psymtab.c (find_pc_sect_psymtab_closer, find_pc_sect_psymbol)
> 	(fixup_psymbol_section, relocate_psymtabs): Update.
> 	(print_partial_symbols): Add 'objfile' parameter.  Update.
> 	(dump_psymtab, add_psymbol_to_bcache, psym_fill_psymbol_map):
> 	Update.

With that caveat, (and IANAM), this LGTM.

Keith



More information about the Gdb-patches mailing list