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@xxxxxxxxxxxx
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077