This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Re: GDB stub support


Hi John, 

> If you specify the ELF executable filename when you launch GDB then
> symbols will be loaded automatically. You can just use "load" with no
> filename and "continue" to start execution. The section records in the
> elf file will indicate where each section must be loaded. You do not
> need to specify the addresses manually.
>

Thank you for your help. Could you tell me the reason why the symbol table won`t be loaded or usable starting GDB without specifying a executable? I can`t see the difference. 
 
>   bash$ mipsisa32-elf-gdb myProgram.elf
>   (gdb) target remote <your parameters>
>   (gdb) load
>   (gdb) break web_init
>   (gdb) continue
> 
> I hope this helps...

Yes it helps a lot. I`m now able to set a breakpoint to a specific function like "web_init" without any error message. 

(gdb) break web_init
Breakpoint 1 at 0x80202054: file ../../.../web.c, line 231.
Warning: the current language does not match this frame.
(gdb) break web.c:1549
No line 1549 in file "../../.../web.c".

Viewing the web.c file by Kwrite, the file will have more than 1549 lines of code. For example, the function "web_init" starts at line 1509 instead of line 231 (recognized by GDB). Could you tell me where the difference will come from and if there`s a trick to specify a breakpoint at the correct line number? 


(gdb) set remotebaud 115200
(gdb) target remote /dev/ttyS0
Remote debugging using /dev/ttyS0
0x8000c44c in ?? ()
(gdb) load
Loading section .rom_vectors, size 0xcc lma 0x80040000
Loading section .rel.dyn, size 0x6c0 lma 0x800400cc
Loading section .text, size 0x313eac lma 0x8004078c
Loading section .rodata, size 0xab630 lma 0x80354638
Loading section .data, size 0xf3828 lma 0x803ffc68
Loading section .ctors, size 0x68 lma 0x804f3490
Loading section .dtors, size 0x44 lma 0x804f34f8
Loading section .devtab, size 0x792c lma 0x804f353c
Start address 0x800400bc, load size 4959848
Transfer rate: 10 KB/sec, 666 bytes/write.
(gdb) step
warning: GDB can't find the start of the function at 0x8000c44c.

    GDB is unable to find the start of the function at 0x8000c44c
and thus can't determine the size of that function's stack frame.
This means that GDB may be unable to access that stack frame, or
the frames below it.
    This problem is most likely caused by an invalid program counter or
stack pointer.
    However, if you think GDB should simply search farther back
from 0x8000c44c for code which looks like the beginning of a
function, you can increase the range of the search using the `set
heuristic-fence-post' command.
Cannot find bounds of current function
(gdb) continue
Continuing.

Unfortunately my software application is not running as expected. It seems to me that the app won`t be executed at all. Using Redboot bootloader to download the elf image by xmodem (at 0x80040000) I just use the command go 0x800400BC and the programm will run.  

Do you have any hints where the problem could be?

best regards
Bernd





> 
> John Dallaway
> eCos maintainer
> http://www.dallaway.org.uk/john
> 
> -- 
> Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
> and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
> 

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]