section problem with GDB (overlay ?)

fanless jlb.for@free.fr
Sun Dec 7 18:20:00 GMT 2008


Hello,

I have a simple application, in which I want to run a portion of code out of
RAM at startup, though using a ram segment which is not yet used at that
time.

To recognise that segment, I give him the 'section' attribute : 
__attribute__ ((section (".ramheap"))) char ramheap[size];

the link script file have the following sections:

.prog (code, size=0x306d4) flash
.data (initialised variable, si=0x424) flash->ram
.ramheap(for heap, size=50000) ram
.bss (for all the other variables, size=0x1e878) ram
.ramprog (program to be run in ram, size=0x820) fash ->ram

As soon as I assign the attribute to aven a small quantities of variables,
GDB does not work correctly, even crashes in another application of same
type.
When it does not crash, it says 'No source available for "start() "'
(start is the first instruction of boot.s, the entry point.)

Even with no .ramprog section, the problem exists. I depends on the size of
allocated ram.
sometimes, if the variable size is large, I have the message :
Dwarf Error: wrong version in compilation unit header (is 0, should be 2)
[in module xxxx.elf]
But a small variable (int var[8]) is enough to make GDB crash.

And a second point : if my program section (.ramprog) is assigned to a ram
section after the .bss section, it works. the debugger shows the source file
when stepping in ram.  But if I assign to .ramprog the start address of
.ramheap, GDB may work sometimes (depending on the size of ram) but I cannot
see the source file for the function when stepping into the code in ram.

Before sending a zipfile with my sample program, can someone tell me if
there is another way of doing this with GDB ? 

tools:
GDB version 6.8.50.
GCC 4.2.2. (option -gdwarf-2)
OpenOCD-r717
Eclipse 3.4

thanks in advance
JL
-- 
View this message in context: http://www.nabble.com/section-problem-with-GDB-%28overlay--%29-tp20883959p20883959.html
Sent from the Sourceware - gdb-patches mailing list archive at Nabble.com.



More information about the Gdb-patches mailing list