From: Brian Ford <ford@vss.fsi.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH] Proper _to_regnum for DWARF on Cygwin
Date: Mon, 19 Apr 2004 16:21:00 -0000 [thread overview]
Message-ID: <Pine.GSO.4.58.0404191015470.16802@thing1-200> (raw)
In-Reply-To: <uk70clauk.fsf@elta.co.il>
On Mon, 19 Apr 2004, Eli Zaretskii wrote:
> On Sun, 18 Apr 2004 20:38:38 +0200 (CEST) Mark Kettenis wrote:
>
>> + /* We typically use DWARF-in-COFF with the dbx register numbering. */
>> + set_gdbarch_dwarf_reg_to_regnum (gdbarch, i386_dbx_reg_to_regnum);
>> + set_gdbarch_dwarf2_reg_to_regnum (gdbarch, i386_dbx_reg_to_regnum);
>
> Mark, doesn't this code above from i386_coff_init_abi contradict the
> code further down (and the register mapping used by GCC), viz:
It does contradict the code further down by design, but not the proposed
DWARF register numbering for Cygwin, which is currently the only target to
call this function. When this patch was written, it was assumed based on
the vanilla FSF GCC sources, that DJGPP would need the same functionality.
Thus the generic function name, but now we know better.
I'm seriously considering reverting that change. I believe my original
gut feeling was correct before Jim Blandy convinced me otherwise.
Comments before I post the patch to do so?
> > + /* Use the SVR4 register numbering scheme for DWARF and DWARF 2. */
> > + set_gdbarch_dwarf_reg_to_regnum (gdbarch, i386_svr4_reg_to_regnum);
> > + set_gdbarch_dwarf2_reg_to_regnum (gdbarch, i386_svr4_reg_to_regnum);
>
> ? For DJGPP, at least, DWARF2-in-COFF uses i386_svr4_reg_to_regnum
> register mapping, not i386_dbx_reg_to_regnum. Am I missing something
> here?
Nope, we were missing the DJGPP specific GCC patch you listed below.
Don't worry, nothing has been broken regardless.
[snip typo comment]
> > + Currently, each GCC i386 target always uses the same register
> > + numbering scheme across all its supported debugging formats
> > + i.e. SDB (COFF), stabs and DWARF 2. This is because
> > + gcc/sdbout.c, gcc/dbxout.c and gcc/dwarf2out.c all use the
> > + DBX_REGISTER_NUMBER macro which is defined by each target's
> > + respective config header in a manner independent of the requested
> > + output debugging format.
>
> As the following fragment (already posted here yesterday) from
> gcc/config/i386/djgpp.h shows, both of these assertions are not true
> for the DJGPP target:
>
> #undef DBX_REGISTER_NUMBER
> #define DBX_REGISTER_NUMBER(n) \
> ((write_symbols == DWARF2_DEBUG) ? svr4_dbx_register_map[n] : dbx_register_map[n])
But we had no way of knowing that ;-).
> Also, in this old message:
>
> http://sources.redhat.com/ml/gdb/2001-07/msg00398.html
>
> you pointed out to me that:
>
> Several GCC targets redefine DBX_REGISTER_NUMBER, see for example
> linux.h in that same directory [gcc/config/i386/].
Yes, but they all follow:
> > + DBX_REGISTER_NUMBER macro which is defined by each target's
> > + respective config header in a manner independent of the requested
> > + output debugging format.
>
> So gcc/*out.c files are clearly not the whole story here (unless
> things have changed in GCC since then; I cannot check this easily
> where I'm typing this).
True. They are not the *whole* story, but it was assumed that examining
all those config files mentioned above was the *relevant* part of the
story.
> The upshot of all this is that either (a) I'm still confused by the
> issues involved, or (b) the comments and, possibly, the code need to
> be amended to clarify/fix that.
a, the comment part of b, and I'm now convinced the code part of b should
be reverted for Cygwin. I'll post a patch soon.
--
Brian Ford
Senior Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
Phone: 314-551-8460
Fax: 314-551-8444
next prev parent reply other threads:[~2004-04-19 16:21 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-13 20:12 Brian Ford
2004-04-16 14:16 ` [PATCH] Proper _to_regnum for DWARF on cygwin (ping for Mark) Christopher Faylor
2004-04-16 16:26 ` Brian Ford
2004-04-16 18:50 ` Christopher Faylor
2004-04-21 15:28 ` [Patch ping] Re: COFF & mixed debug formats Brian Ford
2004-04-30 21:47 ` Brian Ford
2004-05-17 17:08 ` Brian Ford
2004-06-09 15:20 ` Brian Ford
2004-06-09 15:25 ` Daniel Jacobowitz
2004-06-09 21:24 ` Jim Blandy
2004-06-10 0:32 ` Christopher Faylor
2004-06-10 15:54 ` Brian Ford
2004-04-16 16:50 ` [PATCH] Proper _to_regnum for DWARF on Cygwin Mark Kettenis
2004-04-16 17:32 ` Brian Ford
2004-04-18 18:38 ` Mark Kettenis
2004-04-19 5:49 ` Eli Zaretskii
2004-04-19 16:21 ` Brian Ford [this message]
2004-04-19 20:49 ` Jim Blandy
2004-04-20 5:52 ` Eli Zaretskii
2004-04-19 19:59 ` Mark Kettenis
2004-04-19 23:46 ` Brian Ford
2004-04-20 16:30 ` Brian Ford
2004-04-30 20:19 ` 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=Pine.GSO.4.58.0404191015470.16802@thing1-200 \
--to=ford@vss.fsi.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@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