public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* dwarf2 error
@ 2011-06-01 11:09 naga raj
  2011-06-01 15:35 ` Ian Lance Taylor
  0 siblings, 1 reply; 6+ messages in thread
From: naga raj @ 2011-06-01 11:09 UTC (permalink / raw)
  To: gcc-help

Hi,

   I have ported Gcc-4.6 to an embedded target. I have made dwarf2
debugging information as default.

   My error is that my GDB is unable to display local variables of
main function in one of my application program.

   It is giving error as -------> Could not find the frame base for "main".

  But it has all the frame information correctly and backtrace command
in gdb is also working fine.

  The same application program is displaying local variables with
Dwarf3 debugging information.

  I have debugged it an came to know that my GCC generating wrong
loc_ptr address so as a result it is generating that error print
statement.

 Is it a bug or my assumption is wrong??

Thanks in advance,
Nagaraju

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

* Re: dwarf2 error
  2011-06-01 11:09 dwarf2 error naga raj
@ 2011-06-01 15:35 ` Ian Lance Taylor
  2011-06-02  3:58   ` naga raj
  0 siblings, 1 reply; 6+ messages in thread
From: Ian Lance Taylor @ 2011-06-01 15:35 UTC (permalink / raw)
  To: naga raj; +Cc: gcc-help

naga raj <gnuuser.raj@gmail.com> writes:

>    I have ported Gcc-4.6 to an embedded target. I have made dwarf2
> debugging information as default.
>
>    My error is that my GDB is unable to display local variables of
> main function in one of my application program.
>
>    It is giving error as -------> Could not find the frame base for "main".
>
>   But it has all the frame information correctly and backtrace command
> in gdb is also working fine.
>
>   The same application program is displaying local variables with
> Dwarf3 debugging information.
>
>   I have debugged it an came to know that my GCC generating wrong
> loc_ptr address so as a result it is generating that error print
> statement.
>
>  Is it a bug or my assumption is wrong??

Which version of gdb?  It is often the case that newer versions of gcc
require newer versions of gdb.

It is also possible that there is a bug in gcc, but you didn't provide
enough information to know.

Ian

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

* Re: dwarf2 error
  2011-06-01 15:35 ` Ian Lance Taylor
@ 2011-06-02  3:58   ` naga raj
  2011-06-02  5:51     ` Michael Eager
  0 siblings, 1 reply; 6+ messages in thread
From: naga raj @ 2011-06-02  3:58 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: gcc-help, eager

Hi Ian,

   Thanks for the reply.
   I am using gdb-7.2 version and my target is Xilinx microblaze.

Thanks,
Nagaraju M

On Wed, Jun 1, 2011 at 9:05 PM, Ian Lance Taylor <iant@google.com> wrote:
> naga raj <gnuuser.raj@gmail.com> writes:
>
>>    I have ported Gcc-4.6 to an embedded target. I have made dwarf2
>> debugging information as default.
>>
>>    My error is that my GDB is unable to display local variables of
>> main function in one of my application program.
>>
>>    It is giving error as -------> Could not find the frame base for "main".
>>
>>   But it has all the frame information correctly and backtrace command
>> in gdb is also working fine.
>>
>>   The same application program is displaying local variables with
>> Dwarf3 debugging information.
>>
>>   I have debugged it an came to know that my GCC generating wrong
>> loc_ptr address so as a result it is generating that error print
>> statement.
>>
>>  Is it a bug or my assumption is wrong??
>
> Which version of gdb?  It is often the case that newer versions of gcc
> require newer versions of gdb.
>
> It is also possible that there is a bug in gcc, but you didn't provide
> enough information to know.
>
> Ian
>

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

* Re: dwarf2 error
  2011-06-02  3:58   ` naga raj
@ 2011-06-02  5:51     ` Michael Eager
  2011-06-02  6:46       ` naga raj
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Eager @ 2011-06-02  5:51 UTC (permalink / raw)
  To: naga raj; +Cc: Ian Lance Taylor, gcc-help

On 06/01/2011 08:58 PM, naga raj wrote:
> Hi Ian,
>
>     Thanks for the reply.
>     I am using gdb-7.2 version and my target is Xilinx microblaze.

If you put MicroBlaze in the subject line, I'm much more likely to
notice your email.

What sources are you using for GCC?  When you say you ported GCC
to MicroBlaze and made Dwarf debugging the default, this is very
odd, since there is support in GCC-4.6 for MicroBlaze which defaults
to Dwarf debug support.  Gcc-4.1.2 in the Xilinx EDK sources also
support Dwarf debugging.

As Ian said, there isn't enough information to tell whether
there is a bug in gcc or not.

Can you reproduce the error with a small test program?
How are you compiling it?
What gdb commands do you use which causes the error?
What is the Dwarf for the function and variables where the error occurs?
What is the locptr value that you think is incorrect?

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

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

* Re: dwarf2 error
  2011-06-02  5:51     ` Michael Eager
@ 2011-06-02  6:46       ` naga raj
       [not found]         ` <BANLkTin=y4DkMqAzBB-7TM_j5UxFotTGyQ@mail.gmail.com>
  0 siblings, 1 reply; 6+ messages in thread
From: naga raj @ 2011-06-02  6:46 UTC (permalink / raw)
  To: Michael Eager; +Cc: Ian Lance Taylor, gcc-help

[-- Attachment #1: Type: text/plain, Size: 2502 bytes --]

Hi Mike,

   Thanks for your reply.

>Can you reproduce the error with a small test program?
  No, I am unable to reproduce the error. It is working fine with small programs

> How are you compiling it?
I am giving following compiler flags
 -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mcpu=v8.20.a
-mno-xl-soft-mul

> What gdb commands do you use which causes the error?
  (gdb) target remote <ip-addr>:portnumber
  (gdb)load
  (gdb)break main
  (gdb) c
  (gdb)s
   (gdb)print i
    Could not find the frame base for "main"

>What is the Dwarf for the function and variables where the error occurs?
    I dont know how to see Dwarf for the function and variable.
    Please find the attached microblaze-readelf output file.


>What is the locptr value that you think is incorrect?
   In gdb source gdb/gdb/dwarf2loc.c file find_location_expression function
   It is calculating low/high addresses and comparing them with pc
  if (pc >= low && pc < high)
        {
          *locexpr_length = length;
          return loc_ptr;
        }

 But in this particular case this condition is never met as a result I
am getting the error "Could not find the frame base for "main""

The same application is working fine with Dwarf3. I have used
-gdwarf-3 in compilation and now GDN is displaying local variables
correctly.






On Thu, Jun 2, 2011 at 11:21 AM, Michael Eager <eager@eagercon.com> wrote:
> On 06/01/2011 08:58 PM, naga raj wrote:
>>
>> Hi Ian,
>>
>>    Thanks for the reply.
>>    I am using gdb-7.2 version and my target is Xilinx microblaze.
>
> If you put MicroBlaze in the subject line, I'm much more likely to
> notice your email.
>
> What sources are you using for GCC?  When you say you ported GCC
> to MicroBlaze and made Dwarf debugging the default, this is very
> odd, since there is support in GCC-4.6 for MicroBlaze which defaults
> to Dwarf debug support.  Gcc-4.1.2 in the Xilinx EDK sources also
> support Dwarf debugging.
>
> As Ian said, there isn't enough information to tell whether
> there is a bug in gcc or not.
>
> Can you reproduce the error with a small test program?
> How are you compiling it?
> What gdb commands do you use which causes the error?
> What is the Dwarf for the function and variables where the error occurs?
> What is the locptr value that you think is incorrect?
>
> --
> Michael Eager    eager@eagercon.com
> 1960 Park Blvd., Palo Alto, CA 94306  650-325-8077
>

[-- Attachment #2: info --]
[-- Type: application/octet-stream, Size: 16097 bytes --]

ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           Xilinx MicroBlaze
  Version:                           0x1
  Entry point address:               0x0
  Start of program headers:          52 (bytes into file)
  Start of section headers:          105912 (bytes into file)
  Flags:                             0x0
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         6
  Size of section headers:           40 (bytes)
  Number of section headers:         37
  Section header string table index: 34

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  [ 1] .vectors.reset    PROGBITS        00000000 0000f4 000004 00  AX  0   0  4
  [ 2] .vectors.sw_excep PROGBITS        00000008 0000f8 000004 00  AX  0   0  4
  [ 3] .vectors.interrup PROGBITS        00000010 0000fc 000004 00  AX  0   0  4
  [ 4] .vectors.hw_excep PROGBITS        00000020 000100 000004 00  AX  0   0  4
  [ 5] .text             PROGBITS        00000050 000104 0013f4 00 WAX  0   0  4
  [ 6] .init             PROGBITS        00001444 0014f8 000034 00  AX  0   0  4
  [ 7] .fini             PROGBITS        00001478 00152c 00001c 00  AX  0   0  4
  [ 8] .ctors            PROGBITS        00001494 001548 000008 00  WA  0   0  4
  [ 9] .dtors            PROGBITS        0000149c 001550 000008 00  WA  0   0  4
  [10] .rodata           PROGBITS        000014a4 001558 000222 00   A  0   0  4
  [11] .sdata2           NOBITS          000016c6 00177a 000002 00  WA  0   0  1
  [12] .sbss2            PROGBITS        000016c8 0018bc 000000 00   W  0   0  1
  [13] .data             PROGBITS        000016c8 00177c 000138 00  WA  0   0  4
  [14] .eh_frame         PROGBITS        00001800 0018b4 000004 00  WA  0   0  4
  [15] .jcr              PROGBITS        00001804 0018b8 000004 00  WA  0   0  4
  [16] .sdata            PROGBITS        00001808 0018bc 000000 00   W  0   0  1
  [17] .sbss             PROGBITS        00001808 0018bc 000000 00   W  0   0  1
  [18] .tdata            PROGBITS        00001808 0018bc 000000 00   W  0   0  1
  [19] .tbss             NOBITS          00001808 0018bc 000000 00   W  0   0  1
  [20] .bss              NOBITS          00001808 0018bc 00002c 00  WA  0   0  4
  [21] .heap             NOBITS          00001834 0018bc 000004 00  WA  0   0  1
  [22] .stack            NOBITS          00001838 0018bc 000400 00  WA  0   0  1
  [23] .stab             PROGBITS        00000000 0018bc 0002e8 0c     24   0  4
  [24] .stabstr          STRTAB          00000000 001ba4 0000ec 00      0   0  1
  [25] .debug_abbrev     PROGBITS        00000000 001c90 000820 00      0   0  1
  [26] .debug_info       PROGBITS        00000000 0024b0 001785 00      0   0  1
  [27] .debug_line       PROGBITS        00000000 003c35 001573 00      0   0  1
  [28] .debug_macinfo    PROGBITS        00000000 0051a8 012e50 00      0   0  1
  [29] .debug_pubnames   PROGBITS        00000000 017ff8 000328 00      0   0  1
  [30] .debug_frame      PROGBITS        00000000 018320 00030c 00      0   0  4
  [31] .debug_loc        PROGBITS        00000000 01862c 000e20 00      0   0  1
  [32] .debug_aranges    PROGBITS        00000000 019450 0002a0 00      0   0  8
  [33] .debug_str        PROGBITS        00000000 0196f0 000561 00      0   0  1
  [34] .shstrtab         STRTAB          00000000 019c51 000167 00      0   0  1
  [35] .symtab           SYMTAB          00000000 01a380 000ab0 10     36  76  4
  [36] .strtab           STRTAB          00000000 01ae30 00087a 00      0   0  1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings)
  I (info), L (link order), G (group), x (unknown)
  O (extra OS processing required) o (OS specific), p (processor specific)

There are no section groups in this file.

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x0000f4 0x00000000 0x00000000 0x00004 0x00004 R E 0x4
  LOAD           0x0000f8 0x00000008 0x00000008 0x00004 0x00004 R E 0x4
  LOAD           0x0000fc 0x00000010 0x00000010 0x00004 0x00004 R E 0x4
  LOAD           0x000100 0x00000020 0x00000020 0x00004 0x00004 R E 0x4
  LOAD           0x000104 0x00000050 0x00000050 0x01676 0x01678 RWE 0x4
  LOAD           0x00177c 0x000016c8 0x000016c8 0x00140 0x00570 RW  0x4

 Section to Segment mapping:
  Segment Sections...
   00     .vectors.reset 
   01     .vectors.sw_exception 
   02     .vectors.interrupt 
   03     .vectors.hw_exception 
   04     .text .init .fini .ctors .dtors .rodata .sdata2 
   05     .data .eh_frame .jcr .bss .heap .stack 

There is no dynamic section in this file.

There are no relocations in this file.

There are no unwind sections in this file.

Symbol table '.symtab' contains 171 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 00000000     0 SECTION LOCAL  DEFAULT    1 
     2: 00000008     0 SECTION LOCAL  DEFAULT    2 
     3: 00000010     0 SECTION LOCAL  DEFAULT    3 
     4: 00000020     0 SECTION LOCAL  DEFAULT    4 
     5: 00000050     0 SECTION LOCAL  DEFAULT    5 
     6: 00001444     0 SECTION LOCAL  DEFAULT    6 
     7: 00001478     0 SECTION LOCAL  DEFAULT    7 
     8: 00001494     0 SECTION LOCAL  DEFAULT    8 
     9: 0000149c     0 SECTION LOCAL  DEFAULT    9 
    10: 000014a4     0 SECTION LOCAL  DEFAULT   10 
    11: 000016c6     0 SECTION LOCAL  DEFAULT   11 
    12: 000016c8     0 SECTION LOCAL  DEFAULT   12 
    13: 000016c8     0 SECTION LOCAL  DEFAULT   13 
    14: 00001800     0 SECTION LOCAL  DEFAULT   14 
    15: 00001804     0 SECTION LOCAL  DEFAULT   15 
    16: 00001808     0 SECTION LOCAL  DEFAULT   16 
    17: 00001808     0 SECTION LOCAL  DEFAULT   17 
    18: 00001808     0 SECTION LOCAL  DEFAULT   18 
    19: 00001808     0 SECTION LOCAL  DEFAULT   19 
    20: 00001808     0 SECTION LOCAL  DEFAULT   20 
    21: 00001834     0 SECTION LOCAL  DEFAULT   21 
    22: 00001838     0 SECTION LOCAL  DEFAULT   22 
    23: 00000000     0 SECTION LOCAL  DEFAULT   23 
    24: 00000000     0 SECTION LOCAL  DEFAULT   24 
    25: 00000000     0 SECTION LOCAL  DEFAULT   25 
    26: 00000000     0 SECTION LOCAL  DEFAULT   26 
    27: 00000000     0 SECTION LOCAL  DEFAULT   27 
    28: 00000000     0 SECTION LOCAL  DEFAULT   28 
    29: 00000000     0 SECTION LOCAL  DEFAULT   29 
    30: 00000000     0 SECTION LOCAL  DEFAULT   30 
    31: 00000000     0 SECTION LOCAL  DEFAULT   31 
    32: 00000000     0 SECTION LOCAL  DEFAULT   32 
    33: 00000000     0 SECTION LOCAL  DEFAULT   33 
    34: 00000000     0 SECTION LOCAL  DEFAULT   34 
    35: 00000000     0 SECTION LOCAL  DEFAULT   35 
    36: 00000000     0 SECTION LOCAL  DEFAULT   36 
    37: 00000000     0 FILE    LOCAL  DEFAULT  ABS /nagaraju/SPI
    38: 00000008     0 NOTYPE  LOCAL  DEFAULT    2 _vector_sw_exception
    39: 00000010     0 NOTYPE  LOCAL  DEFAULT    3 _vector_interrupt
    40: 00000020     0 NOTYPE  LOCAL  DEFAULT    4 _vector_hw_exception
    41: 000016c8     0 OBJECT  LOCAL  DEFAULT   13 force_to_data
    42: 00001494     0 OBJECT  LOCAL  DEFAULT    8 __CTOR_LIST__
    43: 0000149c     0 OBJECT  LOCAL  DEFAULT    9 __DTOR_LIST__
    44: 00001800     0 OBJECT  LOCAL  DEFAULT   14 __EH_FRAME_BEGIN__
    45: 00001804     0 OBJECT  LOCAL  DEFAULT   15 __JCR_LIST__
    46: 00001808     1 OBJECT  LOCAL  DEFAULT   20 completed.2209
    47: 000016d0     0 OBJECT  LOCAL  DEFAULT   13 p.2207
    48: 00000070     0 NOTYPE  LOCAL  DEFAULT    5 __do_global_dtors_aux
    49: 0000180c    24 OBJECT  LOCAL  DEFAULT   20 object.2262
    50: 000000d0     0 NOTYPE  LOCAL  DEFAULT    5 frame_dummy
    51: 00000000     0 FILE    LOCAL  DEFAULT  ABS /nagaraju/SPI
    52: 00000000     0 FILE    LOCAL  DEFAULT  ABS /gnu/src/gcc/
    53: 00000000     0 FILE    LOCAL  DEFAULT  ABS /gnu/src/gcc/
    54: 00000000     0 FILE    LOCAL  DEFAULT  ABS /gnu/src/gcc/
    55: 00000000     0 FILE    LOCAL  DEFAULT  ABS hw_exception_handler.S
    56: 0000076c    48 FUNC    LOCAL  DEFAULT    5 RotateLeft
    57: 00001824     4 OBJECT  LOCAL  DEFAULT   20 XAssertCallbackRoutine
    58: 00000000     0 FILE    LOCAL  DEFAULT  ABS microblaze_disable_dcache
    59: 00000000     0 FILE    LOCAL  DEFAULT  ABS microblaze_flush_dcache.S
    60: 00001154     0 NOTYPE  LOCAL  DEFAULT    5 L_start
    61: 00001168     0 NOTYPE  LOCAL  DEFAULT    5 L_done
    62: 00000000     0 FILE    LOCAL  DEFAULT  ABS microblaze_invalidate_dca
    63: 0000117c     0 NOTYPE  LOCAL  DEFAULT    5 L_start
    64: 00001190     0 NOTYPE  LOCAL  DEFAULT    5 L_done
    65: 00000000     0 FILE    LOCAL  DEFAULT  ABS microblaze_invalidate_ica
    66: 000011a4     0 NOTYPE  LOCAL  DEFAULT    5 L_start
    67: 000011b8     0 NOTYPE  LOCAL  DEFAULT    5 L_done
    68: 00001828     4 OBJECT  LOCAL  DEFAULT   20 Xil_AssertCallbackRoutine
    69: 0000170c   240 OBJECT  LOCAL  DEFAULT   13 impure_data
    70: 000017fc     0 OBJECT  LOCAL  DEFAULT   13 force_to_data
    71: 00001498     0 OBJECT  LOCAL  DEFAULT    8 __CTOR_END__
    72: 000014a0     0 OBJECT  LOCAL  DEFAULT    9 __DTOR_END__
    73: 00001800     0 OBJECT  LOCAL  DEFAULT   14 __FRAME_END__
    74: 00001804     0 OBJECT  LOCAL  DEFAULT   15 __JCR_END__
    75: 00001404     0 NOTYPE  LOCAL  DEFAULT    5 __do_global_ctors_aux
    76: 00001494     0 NOTYPE  GLOBAL DEFAULT    8 ___CTORS_LIST___
    77: 00000564    72 FUNC    GLOBAL DEFAULT    5 print
    78: 000016f8     8 OBJECT  GLOBAL DEFAULT   13 MB_InterruptVectorTable
    79: 000011c0    52 FUNC    GLOBAL DEFAULT    5 Xil_Assert
    80: 0000049c    52 FUNC    GLOBAL DEFAULT    5 enable_caches
    81: 000001b0   708 FUNC    GLOBAL DEFAULT    5 test_memory_range
    82: 00001808     0 NOTYPE  GLOBAL DEFAULT   17 __sbss_start
    83: 00001130     0 NOTYPE  GLOBAL DEFAULT    5 microblaze_disable_icache
    84: 00001808     0 NOTYPE  GLOBAL DEFAULT   16 __sdata_start
    85: 000014a4     0 NOTYPE  GLOBAL DEFAULT    9 __DTOR_END__
    86: 00000504    48 FUNC    GLOBAL DEFAULT    5 init_platform
    87: 000016c6     0 NOTYPE  GLOBAL DEFAULT   10 __rodata_end
    88: 000016c8     0 NOTYPE  GLOBAL DEFAULT   12 __sbss2_end
    89: 0000182c     4 OBJECT  GLOBAL DEFAULT   20 XAssertStatus
    90: 000016cc     0 OBJECT  GLOBAL HIDDEN   13 __dso_handle
    91: 00000124     0 FUNC    GLOBAL DEFAULT    5 _crtinit
    92: 00001838     0 NOTYPE  GLOBAL DEFAULT   21 _heap_end
    93: 000016c0     4 OBJECT  GLOBAL DEFAULT   10 _global_impure_ptr
    94: 00001834     0 NOTYPE  GLOBAL DEFAULT   20 __bss_end
    95: 00001808     0 NOTYPE  GLOBAL DEFAULT   19 __tbss_start
    96: 00001444     0 NOTYPE  GLOBAL DEFAULT    6 __init
    97: 00001704     4 OBJECT  GLOBAL DEFAULT   13 Xil_AssertWait
    98: 00001838     0 NOTYPE  GLOBAL DEFAULT   21 _heap_start
    99: 00001808     0 NOTYPE  GLOBAL DEFAULT   17 __sbss_end
   100: 00001110     8 FUNC    GLOBAL DEFAULT    5 XNullHandler
   101: 000006e4    24 FUNC    GLOBAL DEFAULT    5 microblaze_register_handl
   102: 00000000     0 NOTYPE  WEAK   DEFAULT  UND __sf_fake_stderr
   103: 00000000     0 NOTYPE  WEAK   DEFAULT  UND __deregister_frame_info
   104: 000016d4    32 OBJECT  GLOBAL DEFAULT   13 memory_ranges
   105: 00001494     0 NOTYPE  GLOBAL DEFAULT    8 __CTOR_LIST__
   106: 00001148     0 NOTYPE  GLOBAL DEFAULT    5 microblaze_flush_dcache
   107: 000016c8     0 NOTYPE  GLOBAL DEFAULT   12 __sbss2_start
   108: 00001118     0 NOTYPE  GLOBAL DEFAULT    5 microblaze_disable_dcache
   109: 0000122c   476 FUNC    GLOBAL DEFAULT    5 __call_exitprocs
   110: 00000000     0 FUNC    GLOBAL DEFAULT    1 _start
   111: 000014a4     0 NOTYPE  GLOBAL DEFAULT   10 __rodata_start
   112: 000010bc    28 FUNC    GLOBAL DEFAULT    5 XUartLite_RecvByte
   113: 00001808     0 NOTYPE  GLOBAL DEFAULT  ABS _SDA_BASE_
   114: 00001800     0 NOTYPE  GLOBAL DEFAULT   13 __data_end
   115: 0000061c     0 NOTYPE  GLOBAL DEFAULT    5 _exception_handler
   116: 0000071c    44 FUNC    GLOBAL DEFAULT    5 Xil_ICacheDisable
   117: 00000740    56 FUNC    GLOBAL DEFAULT    5 Xil_DCacheDisable
   118: 000006f4    44 FUNC    GLOBAL DEFAULT    5 outbyte
   119: 00000dcc   752 FUNC    GLOBAL DEFAULT    5 Xil_TestMem32
   120: 00001198     0 NOTYPE  GLOBAL DEFAULT    5 microblaze_invalidate_ica
   121: 00000000     0 NOTYPE  WEAK   DEFAULT  UND __sf_fake_stdin
   122: 00001808     0 NOTYPE  GLOBAL DEFAULT   20 __bss_start
   123: 00000400     0 NOTYPE  GLOBAL DEFAULT  ABS _STACK_SIZE
   124: 00001808     0 NOTYPE  GLOBAL DEFAULT   18 __tdata_start
   125: 00001808     0 NOTYPE  GLOBAL DEFAULT   18 __tdata_end
   126: 000005a8   120 FUNC    GLOBAL DEFAULT    5 putnum
   127: 000003c4   268 FUNC    GLOBAL DEFAULT    5 main
   128: 00000000     0 NOTYPE  GLOBAL DEFAULT  ABS _HEAP_SIZE
   129: 000004cc    64 FUNC    GLOBAL DEFAULT    5 disable_caches
   130: 00000050     0 FUNC    GLOBAL DEFAULT    5 _start1
   131: 00001838     0 NOTYPE  GLOBAL DEFAULT   22 _stack_end
   132: 00001830     4 OBJECT  GLOBAL DEFAULT   20 Xil_AssertStatus
   133: 000014a4     0 NOTYPE  GLOBAL DEFAULT    9 ___DTORS_END___
   134: 00001808     0 NOTYPE  GLOBAL DEFAULT   16 __sdata_end
   135: 000016c8     0 NOTYPE  GLOBAL DEFAULT   11 __sdata2_start
   136: 0000149c     0 NOTYPE  GLOBAL DEFAULT    8 __CTOR_END__
   137: 0000149c     0 NOTYPE  GLOBAL DEFAULT    9 ___DTORS_LIST___
   138: 00001700     4 OBJECT  GLOBAL DEFAULT   13 XWaitInAssert
   139: 0000149c     0 NOTYPE  GLOBAL DEFAULT    9 __DTOR_LIST__
   140: 00001478     0 NOTYPE  GLOBAL DEFAULT    7 __fini
   141: 00001708     4 OBJECT  GLOBAL DEFAULT   13 _impure_ptr
   142: 000016c8     0 NOTYPE  GLOBAL DEFAULT   11 __sdata2_end
   143: 000016f4     4 OBJECT  GLOBAL DEFAULT   13 n_memory_ranges
   144: 00000650     0 NOTYPE  GLOBAL DEFAULT    5 _interrupt_handler
   145: 0000109c    32 FUNC    GLOBAL DEFAULT    5 XUartLite_SendByte
   146: 0000149c     0 NOTYPE  GLOBAL DEFAULT    8 ___CTORS_END___
   147: 00001c38     0 NOTYPE  GLOBAL DEFAULT   22 __stack
   148: 00001c38     0 NOTYPE  GLOBAL DEFAULT  ABS _end
   149: 00000534    48 FUNC    GLOBAL DEFAULT    5 cleanup_platform
   150: 0000079c   772 FUNC    GLOBAL DEFAULT    5 Xil_TestMem8
   151: 00000a80   876 FUNC    GLOBAL DEFAULT    5 Xil_TestMem16
   152: 00001838     0 NOTYPE  GLOBAL DEFAULT   21 _heap
   153: 000011f8    64 FUNC    GLOBAL DEFAULT    5 exit
   154: 00000634     0 NOTYPE  GLOBAL DEFAULT    5 _hw_exception_handler
   155: 00000638     0 NOTYPE  GLOBAL DEFAULT    5 microblaze_enable_icache
   156: 00001808     0 NOTYPE  GLOBAL DEFAULT   19 __tbss_end
   157: 00000000     0 NOTYPE  WEAK   DEFAULT  UND __sf_fake_stdout
   158: 00001170     0 NOTYPE  GLOBAL DEFAULT    5 microblaze_invalidate_dca
   159: 0000062c     0 NOTYPE  GLOBAL DEFAULT    5 _program_init
   160: 0000006c     0 FUNC    GLOBAL DEFAULT    5 _exit
   161: 00001c38     0 NOTYPE  GLOBAL DEFAULT   22 _stack
   162: 000010d8    52 FUNC    GLOBAL DEFAULT    5 XAssert
   163: 000011ec    16 FUNC    GLOBAL DEFAULT    5 Xil_AssertSetCallback
   164: 000016c8     0 NOTYPE  GLOBAL DEFAULT   13 __data_start
   165: 00000000     0 NOTYPE  WEAK   DEFAULT  UND _Jv_RegisterClasses
   166: 00000624     0 NOTYPE  GLOBAL DEFAULT    5 _program_clean
   167: 00001104    16 FUNC    GLOBAL DEFAULT    5 XAssertSetCallback
   168: 000016c8     0 NOTYPE  GLOBAL DEFAULT  ABS _SDA2_BASE_
   169: 00000000     0 NOTYPE  WEAK   DEFAULT  UND __register_frame_info
   170: 00000650   156 NOTYPE  GLOBAL DEFAULT    5 __interrupt_handler

No version information found in this file.

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

* Re: dwarf2 error
       [not found]         ` <BANLkTin=y4DkMqAzBB-7TM_j5UxFotTGyQ@mail.gmail.com>
@ 2011-06-02 13:02           ` Michael Eager
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Eager @ 2011-06-02 13:02 UTC (permalink / raw)
  To: naga raj; +Cc: gcc-help

On 06/02/2011 12:17 AM, naga raj wrote:
> Hi Mike,
>
>    Please find the attached file which consists of debugging information.

The custom on the GCC mailing list is not to top-post.  Please trim your
reply and add comments at the end or interspersed.  Again, putting MicroBlaze
in the subject line will help me notice the email.

The readelf and dwarf dumps you attached are long.  In the future, please
trim them down to just include the data which is relevant and include in
the body of the email.

 >> How are you compiling it?
 > I am giving following compiler flags
 >  -mlittle-endian -mxl-barrel-shift -mxl-pattern-compare -mcpu=v8.20.a
 > -mno-xl-soft-mul

Clearly these are not all of the flags you are passing to the compiler.
You are generating Dwarf.  What are you specifying to generate debug output?

 >> What is the locptr value that you think is incorrect?
 >   In gdb source gdb/gdb/dwarf2loc.c file find_location_expression function
 >   It is calculating low/high addresses and comparing them with pc
 >  if (pc >= low && pc < high)
 >        {
 >          *locexpr_length = length;
 >          return loc_ptr;
 >        }

What is the locptr value that you think is incorrect?  This would be
from the .debug_loc section for the program.

 > 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?  There are some differences in gcc between Dwarf2
and Dwarf3+, but I don't think that they would affect location exprs.

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

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

end of thread, other threads:[~2011-06-02 13:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-01 11:09 dwarf2 error naga raj
2011-06-01 15:35 ` Ian Lance Taylor
2011-06-02  3:58   ` naga raj
2011-06-02  5:51     ` Michael Eager
2011-06-02  6:46       ` naga raj
     [not found]         ` <BANLkTin=y4DkMqAzBB-7TM_j5UxFotTGyQ@mail.gmail.com>
2011-06-02 13:02           ` 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).