This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: processing dwarf loc


John Smith <ds0163@gmail.com> writes:

> Im working on a source level C debugger using gcc.
> I dont understand the loc section below. What does it mean?


> I processed some other loc-s successfully.
>
>
>  <1><25>: Abbrev Number: 2 (DW_TAG_subprogram)
>     <26>   DW_AT_external    : 1	
>     <27>   DW_AT_name        : (indirect string, offset: 0x27): main	
>     <2b>   DW_AT_decl_file   : 1	
>     <2c>   DW_AT_decl_line   : 5	
>     <2d>   DW_AT_prototyped  : 1	
>     <2e>   DW_AT_type        : <0x74>	
>     <32>   DW_AT_low_pc      : 0x200040	
>     <36>   DW_AT_high_pc     : 0x200054	
>     <3a>   DW_AT_frame_base  : 2 byte block: 7d 0 	(DW_OP_breg13: 0)
>     <3d>   DW_AT_sibling     : <0x74>	
>
>
>  <2><64>: Abbrev Number: 5 (DW_TAG_variable)
>     <65>   DW_AT_name        : (indirect string, offset: 0x0): pLong	
>     <69>   DW_AT_decl_file   : 1	
>     <6a>   DW_AT_decl_line   : 9	
>     <6b>   DW_AT_type        : <0x88>	
>     <6f>   DW_AT_location    : 0x48	(location list)
>
>
>     00000048 00200040 00200048 (DW_OP_const2s: -3072; DW_OP_stack_value)
>     00000048 00200048 0020004c (DW_OP_const2s: -3056; DW_OP_stack_value)
>     00000048 0020004c 00200050 (DW_OP_const2s: -2912; DW_OP_stack_value)
>     00000048 00200050 00200054 (DW_OP_const2s: -3016; DW_OP_stack_value)
>     00000048 <End of list>

The DWARF standards are available at http://dwarfstd.org/ .

There is a bunch of stuff in the above.  Which part do you not
understand?

The loc list at the end is giving you a list of locations on the stack
where the variable may be found.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]