Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: fnf@specifix.com
Cc: gdb-patches@sourceware.org, fnf@specifix.com
Subject: Re: [RFC] DWARF 2 address size != pointer size
Date: Fri, 12 May 2006 19:57:00 -0000	[thread overview]
Message-ID: <200605121951.k4CJp1ao000358@elgar.sibelius.xs4all.nl> (raw)
In-Reply-To: <200605101424.11088.fnf@specifix.com> (message from Fred Fish on 	Wed, 10 May 2006 14:24:10 -0400)

> From: Fred Fish <fnf@specifix.com>
> Date: Wed, 10 May 2006 14:24:10 -0400
> 
> For at least one target, MIPS using the o64 ABI with -mlong64, the
> target DWARF2 address size used in the DWARF info (32 bit) is not the
> same as the target pointer size (64 bit).

Unbelievable.  As if there aren't enough ABI's for MIPS yet.  But how
can this work?  If the pointers are really 64-bit, how can they be
encoded in the 32-bit DWARF2 adresses?

> For example, below are some fragments from dumping the DWARF info
> for a simple test case:
> 
>   Compilation Unit @ 0:
>    Length:        175
>    Version:       2
>    Abbrev Offset: 0
>    Pointer Size:  4	
>  <1><91>: Abbrev Number: 3 (DW_TAG_base_type)
>      DW_AT_name        : long int
>      DW_AT_byte_size   : 8
>  <1><b0>: Abbrev Number: 4 (DW_TAG_pointer_type)
>      DW_AT_byte_size   : 8
> 
> Note that the header records the address size as 4, which is the
> number of bytes written to the DWARF info when writing addresses, but
> that the target pointer size is 8.
> 
> Currently gdb computes the DWARF info address size as:
> 
> 	TARGET_ADDR_BIT / TARGET_CHAR_BIT
> 
> Given that the address size is actually recorded in the compilation
> unit header, I believe the best solution would be to use that recorded
> value somehow.  I spent a couple days looking for an easy way to tie
> the address size to DWARF expressions that were recorded for later
> evaluation, but didn't come up with anything clean enough to submit.
> 
> Another way to divorce the DWARF address size from the TARGET_ADDR_BIT
> is to add another gdbarch paramter, accessed as TARGET_DWARF_ADDR_BIT.
> I've attached a patch that does that.  It's simple, but not my first
> choice for solving the problem.
> 
> Comments?

I think introducing TARGET_DWARF_ADDR_BIT is a mistake if the debug
info already encodes the info.


  parent reply	other threads:[~2006-05-12 19:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-10 18:24 Fred Fish
2006-05-11 22:44 ` Jim Blandy
2006-05-12 14:21   ` Fred Fish
2006-05-12 18:19     ` Jim Blandy
2006-05-12 19:57 ` Mark Kettenis [this message]
2006-05-12 20:07   ` Daniel Jacobowitz
2006-05-12 22:32     ` David S. Miller
2006-05-12 22:42       ` Daniel Jacobowitz

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=200605121951.k4CJp1ao000358@elgar.sibelius.xs4all.nl \
    --to=mark.kettenis@xs4all.nl \
    --cc=fnf@specifix.com \
    --cc=gdb-patches@sourceware.org \
    /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