Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Jack Howarth <howarth@bromo.med.uc.edu>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb@sourceware.org, Dodji Seketeli <dseketel@redhat.com>
Subject: Re: check for valid location of zero length dwarf block forms?
Date: Tue, 24 Nov 2009 08:56:00 -0000	[thread overview]
Message-ID: <20091123141622.GA23363@bromo.med.uc.edu> (raw)
In-Reply-To: <20091123124226.GA7742@host0.dyn.jankratochvil.net>

On Mon, Nov 23, 2009 at 01:42:26PM +0100, Jan Kratochvil wrote:
> On Sun, 22 Nov 2009 21:21:48 +0100, Jack Howarth wrote:
> >    Is this being done in the following code from dwarf2out.c?
> 
> Forwarded it to Dodji:
> 
> On Mon, 23 Nov 2009 10:57:55 +0100, Dodji Seketeli wrote:
> # My understanding is that the code of resolve_addr makes sure that a
> # DW_OP_addr or a DW_AT_const_value does _NOT_ point to a "junk" address.
> # I.E. the function makes sure that if the address does not point to either a
> # const string in .rodata or an address in the current CU (for SYMBOL_REFs),
> # then:
> # - the location list containing the DW_OP_addr is removed
> #   or
> # - the DW_AT_const_value is replaced by a DW_AT_location pointing to an
> #   empty location expression.
> 
> 
> > The problem we have on darwin is that, while Apple will likely fix dsymutils
> > for Xcode 3.2 (Snow Leopard), it probably will remain broken for Tiger and
> > Leopard's devtools. So it would be helpful to find some way to suppress this
> > offending dwarf code on darwin in the cases were the variable has a valid location
> > but is zero length or doesn't have a location.
> 
> I think you can put some workaround
> to dwarf2out.c (output_die <dw_val_class_loc>) but I did not try it.
> 
> 
> Regards,
> Jan

Jon,
   Are you referring to the section in output_die() of gcc/dwarf2out.c which has...

       case dw_val_class_loc:
          size = size_of_locs (AT_loc (a));

          /* Output the block length for this list of location operations.  */
          dw2_asm_output_data (constant_size (size), size, "%s", name);

          output_loc_sequence (AT_loc (a));
          break;

I wonder if I could just do something like...

       case dw_val_class_loc:
          size = size_of_locs (AT_loc (a));

          /* Output the block length for this list of location operations.  */
          dw2_asm_output_data (constant_size (size), size, "%s", name);

          if (dwarf_strict && (size == 0)) 
                 break;
          else 
                output_loc_sequence (AT_loc (a));
          break;

Since only darwin currently defaults to dwarf_strict.
                 Jack


  reply	other threads:[~2009-11-23 14:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-22 17:04 Jack Howarth
2009-11-22 20:22 ` Jan Kratochvil
2009-11-23 14:17   ` Jack Howarth
2009-11-23 19:57     ` Jan Kratochvil
2009-11-24  8:56       ` Jack Howarth [this message]
2009-11-24 19:15         ` Cary Coutant

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=20091123141622.GA23363@bromo.med.uc.edu \
    --to=howarth@bromo.med.uc.edu \
    --cc=dseketel@redhat.com \
    --cc=gdb@sourceware.org \
    --cc=jan.kratochvil@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