Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <kettenis@science.uva.nl>
To: Eli Zaretskii <eliz@is.elta.co.il>
Cc: gdb@sources.redhat.com
Subject: Re: i386 register numbering
Date: Sat, 28 Jul 2001 04:56:00 -0000	[thread overview]
Message-ID: <s3izo9pnuac.fsf@soliton.wins.uva.nl> (raw)
In-Reply-To: <200107281012.GAA02314@delorie.com>

Eli Zaretskii <eliz@delorie.com> writes:

> This happens because the numbering of registers used by GCC differs
> from the one used by GDB, see gcc/config/i386/i386.h in the GCC
> distribution.  Since i386.h seems to be common for all i386 targets,
> I'd expect this problem to pop up on other x86 targets as well (the
> above was tested with DJGPP native debugging).
> 
> Do others indeed see this bug?  If so, what would be the best way of
> fixing it?

The same problem surfaces on i586-pc-linux-gnu, except that GDB thinks
the variable is in %ss.  That illustrates a problem: there are two
register numbering schemes that are in wide use: the "default"
register map (dbx_register_map), and the Dwarf register map
(svr4_dbx_register_map).

In GDB we have STAB_REG_TO_REGNUM, DWARF_REG_TO_REGNUM, etc.  We have
to provide a suitable definition for those in tm-i386.h.  However, the
problem mentioned above makes it a bit tricky, since GCC always uses
the same register numbering scheme, regardless of the actual debugging
format.  Most ELF targets use the Dwarf scheme, even if the debugging
format is stabs.  And it seems that DJGPP uses the "default" scheme,
even if you ask for Dwarf 2 debugging info.

I'm working on a patch, and I'll try to provide some reasonable
defaults.  But most targets will have to override some of these
defaults.

Mark


  reply	other threads:[~2001-07-28  4:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-28  3:14 Eli Zaretskii
2001-07-28  4:56 ` Mark Kettenis [this message]
2001-07-28  5:14   ` Eli Zaretskii
2001-07-28  8:12     ` Andrew Cagney
2001-07-28 10:41       ` Mark Kettenis
2001-07-28 11:06         ` Andrew Cagney
2001-07-28 15:02           ` Mark Kettenis
2001-07-28 18:06             ` Andrew Cagney
2001-07-28 11:02     ` Mark Kettenis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s3izo9pnuac.fsf@soliton.wins.uva.nl \
    --to=kettenis@science.uva.nl \
    --cc=eliz@is.elta.co.il \
    --cc=gdb@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox