public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: dwarf2 error(microblaze)
       [not found] <BANLkTinEuXBU9fUr=38TwgqXqoT=RMZBBg@mail.gmail.com>
@ 2011-06-03 17:31 ` Michael Eager
  2011-06-08  9:23   ` naga raj
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Eager @ 2011-06-03 17:31 UTC (permalink / raw)
  To: naga raj; +Cc: gcc-help

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.

>>> 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)

This appears to be different from the Dwarf dump from your email of
06/02/2011.

What is the location list at offset 0x2c in the .debug_loc section:

> 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?

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: dwarf2 error(microblaze)
  2011-06-03 17:31 ` dwarf2 error(microblaze) Michael Eager
@ 2011-06-08  9:23   ` naga raj
  2011-06-08 22:04     ` Michael Eager
  0 siblings, 1 reply; 3+ messages in thread
From: naga raj @ 2011-06-08  9:23 UTC (permalink / raw)
  To: Michael Eager; +Cc: gcc-help

Hi Mike,

  Sorry for delay in reply. Please find the details.

On Fri, Jun 3, 2011 at 11:01 PM, Michael Eager <eager@eagercon.com> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: dwarf2 error(microblaze)
  2011-06-08  9:23   ` naga raj
@ 2011-06-08 22:04     ` Michael Eager
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Eager @ 2011-06-08 22:04 UTC (permalink / raw)
  To: naga raj; +Cc: gcc-help

On 06/07/2011 11:05 PM, naga raj wrote:

>>> 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"

Previously, you said
 >     I am using gdb-7.2 version and my target is Xilinx microblaze.

The gdb sources which you list do not correspond to gdb-7.2.  Your
listing of find_location_expression shows calling dwarf2_read_address()
but that was replaced with extract_signed_integer() in gdb-7.0.

Again, what version of gcc and gdb are you using?  Are these the
sources from the GNU repository?

Suggestion:

Compile memorytest.c with the default options for the compiler,
without -g3, -gdwarf-3.

Build gdb-7.2 (or GDB from the top of the GNU repository).  See if
you have the same problem.  If you do, print the DWARF for the
function main(), variable i, and the location lists referenced
by both.


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-06-08 17:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <BANLkTinEuXBU9fUr=38TwgqXqoT=RMZBBg@mail.gmail.com>
2011-06-03 17:31 ` dwarf2 error(microblaze) Michael Eager
2011-06-08  9:23   ` naga raj
2011-06-08 22:04     ` Michael Eager

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).