4 Feb 2008 07:39
Re: value of local variable stored in register
Neeraj kushwaha <kushneeraj <at> gmail.com>
2008-02-04 06:39:34 GMT
2008-02-04 06:39:34 GMT
Hi Rohit,
thanks for the reply.
segmentation occurs due to unreferencing null pointer. (this was done
intensionally)
I am running gdb on core dump.
My main intention to get the value of the local variable stored in register.
From the dwarf dump information i can say it was stored in DW_OP_reg2.
Also if for the arithmetic operations, data is moved to register from
memory, but when the printf function returns all the saved register
value should be restored.
this is the dwarf information extracted from a.out
<1>< 276> DW_TAG_subprogram
DW_AT_sibling <341>
DW_AT_external yes(1)
DW_AT_name main
DW_AT_decl_file 1
/home/neeraj/SSG/Release2/gdblocal/2.c
DW_AT_decl_line 5
DW_AT_type <199>
DW_AT_low_pc 0x80483a4
DW_AT_high_pc 0x80483f5
DW_AT_frame_base [
0]<lowpc=0x0><highpc=0x4>DW_OP_breg4+4
[ 1]<lowpc=0x4><highpc=0xa>DW_OP_reg1
(Continue reading)
RSS Feed