Re: dwarf2 error(microblaze)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Mike,

  Sorry for delay in reply. Please find the details.

On Fri, Jun 3, 2011 at 11:01 PM, Michael Eager <eager@xxxxxxxxxxxx> wrote:
> On 06/03/2011 12:18 AM, naga raj wrote:
>
>> Mike,
>
> Please keep discussion which start on gcc-help on the mailing list.
> This allows other people to take a look and offer suggestions.
>
>>>>> How are you compiling it?
>
>>> I have copied the steps from my console which are used in executing
>>>  memory_test project.
>>
>> Invoking: MicroBlaze gcc compiler
>> mb-gcc -Wall -O0 -g3 -gdwarf-3 -c -fmessage-length=0
>> -I../../memory_tests_bsp_0/microblaze_0/include -mxl-barrel-shift
>> -mxl-pattern-compare -mcpu=v8.20.a -mno-xl-soft-mul -MMD -MP
>> -MF"src/memorytest.d" -MT"src/memorytest.d" -o"src/memorytest.o"
>> "../src/memorytest.c"
>
> What is the command line when you have errors?   This is a compile
> which generates Dwarf3, which you say works OK.
>
 I use same options except that -gdward-3

 Invoking: MicroBlaze gcc compiler
 mb-gcc -Wall -O0 -g3 -c -fmessage-length=0
 -I../../memory_tests_bsp_0/microblaze_0/include -mxl-barrel-shift
 -mxl-pattern-compare -mcpu=v8.20.a -mno-xl-soft-mul -MMD -MP
 -MF"src/memorytest.d" -MT"src/memorytest.d" -o"src/memorytest.o"
 "../src/memorytest.c"

>>>> The same application is working fine with Dwarf3. I have used
>>>> -gdwarf-3 in compilation and now GDN is displaying local variables
>>>> correctly.
>>>
>>> What are the differences in the Dwarf output between compiling with
>>> -g and -gdwarf-3?
>>
>> dwarf2 debugging information:
>>     <1><47a>: Abbrev Number: 13 (DW_TAG_subprogram)
>>     <47b>    DW_AT_external    : 1
>>     <47c>    DW_AT_name        : (indirect string, offset: 0xf4): main
>>     <480>    DW_AT_decl_file   : 1
>>     <481>    DW_AT_decl_line   : 59
>>     <482>    DW_AT_type        :<0x390>
>>     <486>    DW_AT_low_pc      : 0x3dc
>>     <48a>    DW_AT_high_pc     : 0x490
>>     <48e>    DW_AT_frame_base  : 0x2c    (location list)
>>     <492>    DW_AT_sibling     :<0x4a3>
>>  <2><496>: Abbrev Number: 14 (DW_TAG_variable)
>>     <497>    DW_AT_name        : i
>>     <499>    DW_AT_decl_file   : 1
>>     <49a>    DW_AT_decl_line   : 61
>>     <49b>    DW_AT_type        :<0x390>
>>     <49f>    DW_AT_location    : 2 byte block: 91 78     (DW_OP_fbreg: -8)


> What is the location list at offset 0x2c in the .debug_loc section:
    0000002c 0000048c 00000490 (DW_OP_breg1 (r1): 0)
    0000002c 00000490 0000049c (DW_OP_breg1 (r1): 36)
    0000002c 0000049c 00000570 (DW_OP_breg19 (r19): 36)
    0000002c <End of list>


>> dwarf3 debugging information:
>>  <1><468>: Abbrev Number: 13 (DW_TAG_subprogram)
>>     <469>    DW_AT_external    : 1
>>     <46a>    DW_AT_name        : (indirect string, offset: 0xf4): main
>>     <46e>    DW_AT_decl_file   : 1
>>     <46f>    DW_AT_decl_line   : 59
>>     <470>    DW_AT_type        :<0x388>
>>     <474>    DW_AT_low_pc      : 0x3dc
>>     <478>    DW_AT_high_pc     : 0x490
>>     <47c>    DW_AT_frame_base  : 1 byte block: 9c
>>  (DW_OP_call_frame_cfa)
>>     <47e>    DW_AT_sibling     :<0x48f>
>>  <2><482>: Abbrev Number: 14 (DW_TAG_variable)
>>     <483>    DW_AT_name        : i
>>     <485>    DW_AT_decl_file   : 1
>>     <486>    DW_AT_decl_line   : 61
>>     <487>    DW_AT_type        :<0x388>
>>     <48b>    DW_AT_location    : 2 byte block: 91 78     (DW_OP_fbreg: -8)
>
>
>> Please go through the gdb dump:
>
> Like long ELF or DWARF dumps, please don't send long debug logs
> where you single step through dozens of statements displaying a
> variety of variables.
>
>>   Breakpoint 1, main () at ../src/memorytest.c:62
>> 62          i =20;
>> (gdb) n
>> 63          init_platform();
>> (gdb) p i
>>
>> Breakpoint 1, find_location_expression (baton=0x8c5f1ec,
>> locexpr_length=0xbff405ac, pc=1012)
>>     at /build/lin/bld_gdb/gdb/gdb/dwarf2loc.c:62
>
> What is the location expression that gdb is trying to parse?

location expression contains these values
0x2bc, 0x0, 0x2c0, 0x0, 0x1, 0xc051, 0x2, 0xcc00, 0x2, 0x200, 0x7100,
0xcc24, 0x2, 0xa400, 0x3, 0x200, 0x8300, 0x24, 0x0, 0x0, 0x0, 0x0,
0x0, 0x400, 0x0, 0x100, 0x5100, 0x4, 0x0, 0x10, 0x0, 0x2, 0x2071,
0x10, 0x0, 0x34, 0x0, 0x2, 0x2083, 0x0

and locexpr_length contains these fields
0x1ff8, 0xbff4, 0x1aa1, 0x52, 0x9820, 0x5e, 0xfff8, 0xffff, 0xffff,
0xffff, 0x2a14, 0xbff4, 0x29a0, 0xbff4, 0x2018, 0xbff4, 0x3b69, 0x805,
0x28, 0x0, 0x91, 0x0,
  0x2028, 0xbff4, 0xaba8, 0x818, 0xbdc8, 0x8b5, 0xbf39, 0x8b3, 0xbf39,
0x8b3, 0xa9a6, 0x818, 0x28, 0x0, 0x34, 0x0, 0x2098, 0xbff4


Thanks,
Nagaraju



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux