[Dwarf-Discuss] how to find local variable stored in register

Michael Eager eager@eagercon.com
Mon Feb 4 23:19:43 GMT 2008


Frank Ch. Eigler wrote:
> Hi -
> 
> On Mon, Feb 04, 2008 at 09:50:24AM +0530, Neeraj kushwaha wrote:
>> [...]
>> DW_AT_name = b
>> [...]
>> DW_AT_location = DW_OP_reg0
>> From this dwarf debug information I get that local variable b is stored at
>> DW_OP_reg0. But how to find this register value. 
> 
> The mechanics of actually fetching a register from a target processor
> is beyond the scope of dwarf.
> 
> 
>> Suppose this foo() funciton call another function, then this
>> register value will get stored in stack before invoking the function
>> call.
> 
> A truthful compiler will add extra location records for this variable
> for the time (PC ranges) when its value is on the stack.

DWARF does not describe where variables are saved as result of a
function call.  This is specified by the processor ABI.

-- 
Michael Eager	 eager at eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077




More information about the Dwarf-discuss mailing list