From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16582 invoked by alias); 19 Apr 2004 05:49:15 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 16574 invoked from network); 19 Apr 2004 05:49:14 -0000 Received: from unknown (HELO monty-python.gnu.org) (199.232.76.173) by sources.redhat.com with SMTP; 19 Apr 2004 05:49:14 -0000 Received: from [207.232.27.5] (helo=WST0054) by monty-python.gnu.org with asmtp (Exim 4.30) id 1BFReQ-0003ns-Pc; Mon, 19 Apr 2004 01:49:03 -0400 Date: Mon, 19 Apr 2004 05:49:00 -0000 Message-Id: From: Eli Zaretskii To: Mark Kettenis CC: ford@vss.fsi.com, gdb-patches@sources.redhat.com In-reply-to: <200404181838.i3IIccMf006115@elgar.kettenis.dyndns.org> (message from Mark Kettenis on Sun, 18 Apr 2004 20:38:38 +0200 (CEST)) Subject: Re: [PATCH] Proper _to_regnum for DWARF on Cygwin Reply-to: Eli Zaretskii References: <200404161650.i3GGoPxI054716@elgar.kettenis.dyndns.org> <200404181838.i3IIccMf006115@elgar.kettenis.dyndns.org> X-SW-Source: 2004-04/txt/msg00411.txt.bz2 > Date: Sun, 18 Apr 2004 20:38:38 +0200 (CEST) > From: Mark Kettenis > > + /* 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.