Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@elta.co.il>
To: Mark Kettenis <kettenis@chello.nl>
Cc: ford@vss.fsi.com, gdb-patches@sources.redhat.com
Subject: Re: [PATCH] Proper _to_regnum for DWARF on Cygwin
Date: Mon, 19 Apr 2004 05:49:00 -0000	[thread overview]
Message-ID: <uk70clauk.fsf@elta.co.il> (raw)
In-Reply-To: <200404181838.i3IIccMf006115@elgar.kettenis.dyndns.org> (message from Mark Kettenis on Sun, 18 Apr 2004 20:38:38 +0200 (CEST))

> Date: Sun, 18 Apr 2004 20:38:38 +0200 (CEST)
> From: Mark Kettenis <kettenis@chello.nl>
> 
> +  /* 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:

> +  /* 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?

> +  /* NOTE: kettenis/20040418: GCC does have two possible register
> +     numbering schemes on the i386: dbx and SVR4.  These schemes
> +     differ in how they number %ebp, %esp, %eflags, and the
> +     floating-point registers, and are implemented by the attays
                                                             ^^^^^^
A typo.

> +     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])

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/].

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).

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.


  reply	other threads:[~2004-04-19  5:49 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 [this message]
2004-04-19 16:21         ` Brian Ford
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=uk70clauk.fsf@elta.co.il \
    --to=eliz@elta.co.il \
    --cc=eliz@gnu.org \
    --cc=ford@vss.fsi.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kettenis@chello.nl \
    /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