From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Tue, 7 May 1996 10:48:47 -0500 (CDT) From: Richard Henderson Subject: Re: gdb In-Reply-To: <199605071423.HAA24354@koala.azstarnet.com> Harald> Hi, does anyone have a patch for gdb which would allow to Harald> display the sybmolic destination of a JSR like this Harald> a77db248 ldq t12, -19896(gp) Harald> 6b5b6c2a jsr ra, (t12), 0x12004c0e4 Harald> and other accesses via (gp) for the disassebmle or x/i Harald> instruction for a running process ? DMT> In general, this can't be done reliably since the bits in the jsr DMT> instruction are a hint only. And the hint is so small that many times DMT> the target address you'd get based on the hint would be wrong. DMT> Displaying a wrong hint can be very confusing and is IMHO worse than DMT> saying nothing at all. I'm guessing that Harold just wants to know what symbol lives at -19896(gp). Since the contents of the registers are not available in the context of the disassembler, some sort of code search would have to be performed to find out what $gp should be. Once that was available, printing the symbol whose address is being referenced in the GOT is trivial. I'll think about it and see how hard it would be to get hold of the gp. r~