[Dwarf-Discuss] find local variable information from the dwarf

Neeraj kushwaha kushneeraj at gmail.com
Mon Jan 21 17:38:39 PST 2008


Thanks for the reply.

But how to interpret these lines

>*         DW_AT_frame_base            [
*>* 0]<lowpc=0x24><highpc=0x28>DW_OP_breg4+4
*>*                     [ 1]<lowpc=0x28><highpc=0x2e>DW_OP_reg1
*>*                     [ 2]<lowpc=0x2e><highpc=0x2f>DW_OP_breg4+4
*>*                     [ 3]<lowpc=0x2f><highpc=0x31>DW_OP_breg4+8
*>*                     [ 4]<lowpc=0x31><highpc=0x56>DW_OP_breg5+8
*

Please explain briefly.



Regards

Neeraj

On Jan 22, 2008 12:50 AM, David Anderson <davea42 at earthlink.net> wrote:

> Neeraj kushwaha wrote:
> > Hi All,
> >
> > I am trying to find the location and value of local variable in a stack
> > frame from the core dump.
> > As GDB can fetch the value and location of local variable using the
> > information from the dwarf debugging format.
> >
> > I am trying to manually find the location and value of the local
> variable
> > from the core.
> >
> > This is what i did; from the a.out, I extracted the dwarf information
> using
> > "dwarfdump -a a.out"
> >
> > and using the GDB i am trying to print the dump from the core "x/88b
> main1"
> >
> > But I am not able to find the location information of the local variable
> >
> > for example:
> >
> >         DW_AT_name                  c
> >         DW_AT_decl_file             1 /home/neeraj/4.c
> >         DW_AT_decl_line             15
> >         DW_AT_type                  <177>
> >         DW_AT_location              DW_OP_fbreg -20
> >
> >
> > local variable is at location DW_OP_fbreg - 20. But how to find the
> > DW_OP_fbreg?
> >
> >
>
> Look back a few lines.  The fbreg is defined in the subprogram
> DIE (DW_AT_frame_base):
>
> > <1><  315>    DW_TAG_subprogram
> >         DW_AT_external              yes(1)
> >         DW_AT_name                  main
> >         DW_AT_decl_file             1 /home/neeraj/4.c
> >         DW_AT_decl_line             14
> >         DW_AT_type                  <177>
> >         DW_AT_low_pc                0x8048398
> >         DW_AT_high_pc               0x80483ca
> >         DW_AT_frame_base            [
> > 0]<lowpc=0x24><highpc=0x28>DW_OP_breg4+4
> >                     [ 1]<lowpc=0x28><highpc=0x2e>DW_OP_reg1
> >                     [ 2]<lowpc=0x2e><highpc=0x2f>DW_OP_breg4+4
> >                     [ 3]<lowpc=0x2f><highpc=0x31>DW_OP_breg4+8
> >                     [ 4]<lowpc=0x31><highpc=0x56>DW_OP_breg5+8
> >
>
> Hope that helps.
> David Anderson.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dwarfstd.org/private.cgi/dwarf-discuss-dwarfstd.org/attachments/20080122/a30feedf/attachment-0002.htm>


More information about the Dwarf-Discuss mailing list