check for valid location of zero length dwarf block forms?
Jack Howarth
howarth@bromo.med.uc.edu
Tue Nov 24 08:56:00 GMT 2009
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
More information about the Gdb
mailing list