From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Thu, 9 May 1996 11:04:39 -0500 (CDT) From: Richard Henderson Subject: Re: gdb In-Reply-To: <9605090859.AA09338@nova.tat.physik.uni-tuebingen.de> > my idea was just to use the actual gp value from the registers ("info reg") > which would allow to check these addresses at least for the current subroutine > when using breakpoints. not a really general solution but quite helpful > for the few "disassembler sessions" I've had so far. Two problems: (1) the disassembler cannot get hold of the registers under gdb, and (2) it must also work when invoked under objdump in which there are no registers and no coherant table from which to extract the addresses. Perhaps easier would be to have some simple macro to print a symbol name given a gp offset. Something like gdb> pgp -1234 $2 = {int ()} 0x140040274 Without testing, try: define pgp p *((int (*))($ + $gp)) end which would actually require you to type gdb> p -1234 $1 = (int) -1234 gdb> pgp $2 = {int ()} 0x123456789 At some point, they really ought to add arguments to gdb macros. r~