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

[openrisc] Gdb Debuginfo for variables in the data-segment



Hi!

I'm trying to debug a very simple program using
gdb over the jtag-port. It works mostly fine, but
the variables in the data-segment seem to have no
debug info, whereas static variables and variables
on the stack have correct debug info.

Below is my simple test-program and link-script.
and a sample gdb-debugging-session. As you see
gdb has no info about the variable 'a' (the adress
to it can be retrieved using _a, though, but then
all type-info is lost).  I've tried to add more stuff
to the link-script but winthout sucess.
Does anyone know if its possible to get this info
for variables in the data-segment?

----- c-file ----------------

int a[] = {1,2};
static int b[] = {3,4};
void start() {
  int c[] = {5,6};
}

----- link-script ------------

MEMORY
        {
        ram : ORIGIN = 0x08110000, LENGTH = 0x01000000
        }

SECTIONS
{
        .text : { *(.text) } > ram
        .data : { *(.data) } > ram
        .rodata : { *(.rodata) } > ram

        . = ALIGN( 0x4 );
        __bss_start = .;

        .bss : { *(.bss) } > ram

        . = ALIGN( 0x4 );
        _end = .; /* needed by newlib */
}

----- sample gdbsession -------------


(gdb) file simple2.or32
A program is being debugged already.  Kill it? (y or n) y

Load new symbol table from "simple2.or32"? (y or n) y

Reading symbols from simple2.or32...done.
(gdb) target jtag jtag://localhost:9999
Remote or1k debugging using jtag://localhost:9999
0x0 in ?? ()
(gdb) load
Loading section .text, size 0x28 lma 0x8110000
Loading section .data, size 0x10 lma 0x8110028
Start address 0x8110000 , load size 56
Transfer rate: 448 bits in <1 sec, 28 bytes/write.
(gdb) p a
Address of symbol "a" is unknown.
(gdb) p b
$2 = {3, 4}
(gdb) p (&_a)
$5 = (<data variable, no debug info> *) 0x8110028
(gdb) p *(int*)(&_a)
$7 = 1
(gdb) p *(int*)(&_a+1)
$8 = 2
(gdb)


--
To unsubscribe from openrisc mailing list please visit http://www.opencores.org/mailinglists.shtml