From: Cary Coutant <ccoutant@google.com>
To: Jack Howarth <howarth@bromo.med.uc.edu>
Cc: Jan Kratochvil <jan.kratochvil@redhat.com>,
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 19:15:00 -0000 [thread overview]
Message-ID: <c17be2b30911231157x4bc3b7bcheb3ec593bbb5fdac@mail.gmail.com> (raw)
In-Reply-To: <20091123141622.GA23363@bromo.med.uc.edu>
> 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;
By the time we get to output_die(), the abbrev code has already been
chosen, DIE offsets have been calculated, and a DW_AT_location
attribute of a known size is expected. Skipping it completely here
will break the DWARF output.
I think what you would want to do instead is change resolve_addr()
either to remove the DW_AT_location attribute from the DIE instead of
setting dw_attr_val.v.val_loc to NULL, or to set dw_attr_val.v.val_loc
to a DWARF expression containing nothing but DW_OP_nop. In the
dw_val_class_loc_list case, I'm not sure if the Apple tool is picky
enough to complain about zero-length location expressions there, too;
if it is, you'll either need to remove a NULL expr from the location
list, or set it to a DW_OP_nop as well.
I haven't looked to see if there are other places besides
resolve_addr() that might generate a null location expression.
In the long run, though, the Apple tools should be fixed. An empty
DWARF location expression is well defined and valid.
-cary
prev parent reply other threads:[~2009-11-23 19:57 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
2009-11-24 19:15 ` Cary Coutant [this message]
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=c17be2b30911231157x4bc3b7bcheb3ec593bbb5fdac@mail.gmail.com \
--to=ccoutant@google.com \
--cc=dseketel@redhat.com \
--cc=gdb@sourceware.org \
--cc=howarth@bromo.med.uc.edu \
--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