Gdb generates location list without DW_AT_frame_base

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


>
> This patch seems to generate better debug info.

You missed a whole bunch of cases where we are arbitrarily passing true to 
mem_loc_descriptor or loc_descriptor.
You also *can* generate a frame base for the testcase you sent me, we just 
don't use all the info we could to generate it.
See the last patch i sent you which adds code to the 
add_location_or_const_value_attribute routine.

Also, whether we generate a frame_base has *nothing* to do with the 
setting of TREE_PUBLIC.

The code says:

else if (!DECL_EXTERNAL (decl))
{
....


       /* Define the "frame base" location for this routine.  We use the
 	 frame pointer or stack pointer registers, since the RTL for local
 	 variables is relative to one of them.  */
       if (frame_base_decl && lookup_decl_loc (frame_base_decl) != NULL)
 	{
 	  add_location_or_const_value_attribute (subr_die, 
frame_base_decl,
 						 DW_AT_frame_base);
 	}
       else
 	{
 	  fp_reg
 	    = frame_pointer_needed ? hard_frame_pointer_rtx : 
stack_pointer_rtx;
 	  add_AT_loc (subr_die, DW_AT_frame_base, reg_loc_descriptor 
(fp_reg));
 	}

}



More information about the Gdb mailing list