public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* register_offset_hack() vs REGISTER_BYTE()
@ 2003-05-02  0:38 Kevin Buettner
  2003-05-02  0:58 ` Andrew Cagney
  0 siblings, 1 reply; 7+ messages in thread
From: Kevin Buettner @ 2003-05-02  0:38 UTC (permalink / raw)
  To: gdb

I'm seeing the following internal error:

    .../frame.c:591: internal-error: Failed to compute the register number
    corresponding to 0x296

This is happening because the *addrp value in the following loop (which
is in frame_register() in frame.c)...

          for (regnum = 0; regnum < NUM_REGS + NUM_PSEUDO_REGS; regnum++)
            {
              if (*addrp == register_offset_hack (current_gdbarch, regnum))
                {
                  *realnump = regnum;
                  return;
                }
            }

...is set using a value obtained from REGISTER_BYTE().  (See
sentinel_frame_prev_register in sentinel-frame.c.)  But the
value obtained from register_offset_hack() was computed by using the
register's virtual type.  For this particular architecture (64-bit MIPS),
there are some registers whose virtual size is 4, but which are stored
in an 8-byte container.  Hence the discrepancy.

It's not clear to me that the values being returned by register_offset_hack()
are all that useful.  These are offsets which would occur if you squeezed
all of the "unused" space out of the registers array.

IMO, the call to register_offset_hack() should be replaced with a call
to REGISTER_BYTE().

Opinions?

Kevin

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-05-02 23:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-02  0:38 register_offset_hack() vs REGISTER_BYTE() Kevin Buettner
2003-05-02  0:58 ` Andrew Cagney
2003-05-02  1:09   ` Kevin Buettner
2003-05-02  1:30     ` Andrew Cagney
2003-05-02 22:26       ` Andrew Cagney
2003-05-02 22:57         ` Kevin Buettner
2003-05-02 23:16           ` Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).