Gdb generates location list without DW_AT_frame_base
Daniel Berlin
dberlin@dberlin.org
Fri Dec 31 00:56:00 GMT 2004
On Thu, 30 Dec 2004, H. J. Lu wrote:
> On Thu, Dec 30, 2004 at 03:56:33PM -0500, Daniel Berlin wrote:
>>
>>> And what's in the location lists? If it's DW_OP_fbreg, then I presume
>>> it's a GCC bug. According to my reading of the DWARF spec, anyway.
>> It is.
>>
>> I added code to tell it when not to use fbreg, but i only told it not to
>> use fbreg in the location expression when we were outputting the
>> frame_base attribute.
>>
>> However, it appears we don't output a frame base attribute for external
>> procedures, so we need to tell it it can't use if we don't have a frame
>> base attribute.
>>
>> You just need to change when loc_descriptor is called with a second
>> parameter of true/1 to fix this.
>
> Do you have a patch I can try?
This may not fix all of them, but it should help.
-------------- next part --------------
Index: dwarf2out.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dwarf2out.c,v
retrieving revision 1.564
diff -u -p -r1.564 dwarf2out.c
--- dwarf2out.c 24 Dec 2004 05:23:07 -0000 1.564
+++ dwarf2out.c 31 Dec 2004 00:34:38 -0000
@@ -9980,6 +9980,7 @@ add_location_or_const_value_attribute (d
rtx rtl;
dw_loc_descr_ref descr;
var_loc_list *loc_list;
+ bool can_use_fb = attr != DW_AT_frame_base && !DECL_EXTERNAL (decl);
if (TREE_CODE (decl) == ERROR_MARK)
return;
@@ -10049,7 +10050,7 @@ add_location_or_const_value_attribute (d
varloc = NOTE_VAR_LOCATION (node->var_loc_note);
add_loc_descr_to_loc_list (&list,
loc_descriptor (varloc,
- attr != DW_AT_frame_base),
+ can_use_fb),
node->label, node->next->label, secname);
}
@@ -10070,7 +10071,7 @@ add_location_or_const_value_attribute (d
}
add_loc_descr_to_loc_list (&list,
loc_descriptor (varloc,
- attr != DW_AT_frame_base),
+ can_use_fb),
node->label, endname, secname);
}
More information about the Gcc
mailing list