gcc 4.0 generates location list without DW_AT_frame_base

Daniel Berlin dberlin@dberlin.org
Fri Dec 31 20:09:00 GMT 2004


Yes
Attached is a patch that should fix it.
We weren't generating frame base in all the cases we could.

Please let me know if this doesn't fix all the cases, because if so, there 
is a bit more i can do.


On Fri, 31 Dec 2004, H. J. Lu wrote:

> On Fri, Dec 31, 2004 at 12:00:32PM -0500, Daniel Berlin wrote:
>>>
>>> It doesn't help tls_symbolic_operand at all.
>>
>> Then i need you to determine where loc_descriptor is called with
>> can_use_fbreg == 1 for the location list that you are referring to
>>
>
> I updated PR 19124 with a small testcase and the output from readelf.
> The questionable debug info is marked with `[without DW_AT_frame_base]'.
> Will it enough for you to debug it?
>
>
> H.J.
>
-------------- 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 19:51:00 -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;
@@ -10037,7 +10038,7 @@ add_location_or_const_value_attribute (d
 
       node = loc_list->first;
       varloc = NOTE_VAR_LOCATION (node->var_loc_note);
-      list = new_loc_list (loc_descriptor (varloc, attr != DW_AT_frame_base),
+      list = new_loc_list (loc_descriptor (varloc, can_use_fb),
 			   node->label, node->next->label, secname, 1);
       node = node->next;
 
@@ -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);
 	}
 
@@ -11599,9 +11600,10 @@ gen_inlined_subroutine_die (tree stmt, d
      emit the block below (or elsewhere), we may end up trying to emit
      a die whose origin die hasn't been emitted, and crashing.  */
   dwarf2out_abstract_function (decl);
-
+  
   if (! BLOCK_ABSTRACT (stmt))
     {
+      
       dw_die_ref subr_die
 	= new_die (DW_TAG_inlined_subroutine, context_die, stmt);
       char label[MAX_ARTIFICIAL_LABEL_BYTES];


More information about the Gcc mailing list