Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@redhat.com>
To: fnf@ninemoons.com
Cc: gcc-bugs@gcc.gnu.org, gdb@sources.redhat.com
Subject: Re: [RFC] Possible gcc/DWARF or gdb/DWARF problem
Date: Mon, 01 Dec 2003 15:21:00 -0000	[thread overview]
Message-ID: <vt28ylw5zuh.fsf@zenia.home> (raw)
In-Reply-To: <200311292026.hATKQ3OI025805@fred.ninemoons.com>


Fred Fish <fnf@public.ninemoons.com> writes:
> For reference, here are the relevant parts of the dwarfdump output:
> 
>   <1><  107>      DW_TAG_base_type
>                   DW_AT_name                  signed char
>                   DW_AT_byte_size             1
>                   DW_AT_encoding              DW_ATE_signed_char
>   
>   <2><  160>      DW_TAG_variable
>                   DW_AT_name                  l
>                   DW_AT_decl_file             1 /tmp/b.c
>                   DW_AT_decl_line             8
>                   DW_AT_type                  <107>
>                   DW_AT_location              DW_OP_fbreg 0
> 
> I'd like to get some comments on whether this is a gcc/DWARF or
> gdb/DWARF issue.  If the consensus is that gdb is not doing the right
> thing, then I'll chase the problem in gdb.  If the consensus is that
> it is gcc, then I'll file a formal gcc bug report.  My guess is that
> since gcc is generating the memory offset of a 1 byte object relative
> to the frame pointer that the DW_AT_location for the big endian case
> should be:
> 
>                   DW_AT_location              DW_OP_fbreg 3

So, in the big-endian case, the compiler is generating code that
places the one-byte value at offset 3 from the frame base register.
(Since you say the code for the little-endian and big-endian cases is
identical, we know it uses 32-bit stores and loads to fb+0 to access
it, but that's irrelevant; it's a one-byte value.)  Right?

You're right --- GCC is wrong.  The Dwarf 2 info it's producing
clearly describes a one-byte value at offset 0 from the frame base.
How GCC decides to generate code to access it is not our problem.


  parent reply	other threads:[~2003-12-01 15:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-29 20:26 Fred Fish
2003-12-01  1:54 ` Daniel Jacobowitz
2003-12-01 15:21 ` Jim Blandy [this message]
2003-12-01 16:42   ` Fred Fish

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=vt28ylw5zuh.fsf@zenia.home \
    --to=jimb@redhat.com \
    --cc=fnf@ninemoons.com \
    --cc=gcc-bugs@gcc.gnu.org \
    --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