This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch/rfc] Recognize non-DW_AT_location <value optimized out> symbols
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 20 Mar 2009 11:02:48 -0400
- Subject: Re: [patch/rfc] Recognize non-DW_AT_location <value optimized out> symbols
- References: <20090316202040.GA27070@host0.dyn.jankratochvil.net>
Hi Jan,
> * zero-length DW_AT_location should be the same as missing DW_AT_location.
> https://fedorahosted.org/pipermail/elfutils-devel/2009-March/000180.html
I agree.
I have been trying to understand what is going on in this patch, so
can you bear with me?
The first observation is that dwarf2read treats zero-length DW_AT_location
lists as LOC_OPTIMIZED_OUT. See var_decode_location:
/* A DW_AT_location attribute with no contents indicates that a
variable has been optimized away. */
if (attr_form_is_block (attr) && DW_BLOCK (attr)->size == 0)
{
SYMBOL_CLASS (sym) = LOC_OPTIMIZED_OUT;
return;
}
I'll see if I can reproduce using the testcase you provided (I don't
have gcc-4.4 handy, so I can't use the C example you gave).
--
Joel