I need, for a simple application, in which I want to run a portion of code out of RAM at startup, to use a ram segment which is not yet used at that time.
For that purpose, I give a variable which will be used later in the firmware as heap (FreeRTOS with lwip) the ‘section’ attribute :
__attribute__ ((section (".ramheap"))) char ramheap[size];
However, as soon as size is arround 64, GDB does not work properly any more.
‘No source available for "start() "’
(start is the first instruction of boot.s, the entry point in assembler module, and startup breakpoint)
If I set size to 4, it works !
If I set the startup breakpoint at ‘main’, it works too.
However, if I add a program section that overlays on ramheap section (‘ram >flash’ in link script) , GDB does not show the source lines of that code, while it does if the program section is located at an address other than ramheap or bss (can be after bss or between ramheap and bss) (this is a second problem).
In another larger application, I’ve go the message
Dwarf Error: wrong version in compilation unit header (is 0, should be 2) [in module xxxx.elf]
and sometimes, with only an 8 byte variable with the attribute ‘section’ is enough to make GDB crash.
GDB version 6.8.50.
GCC 4.2.2. (option -gdwarf-2)
I can send a zip file with all the sources if necessary… it just a simple demo program, easy to reproduce…
thanks in advance for any tip.