public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "Bernd Schuster" <schuster_bernd@gmx.net>
To: John Dallaway <john@dallaway.org.uk>
Cc: ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] Re: GDB stub support
Date: Tue, 18 Dec 2012 11:56:00 -0000	[thread overview]
Message-ID: <20121218115648.274280@gmx.net> (raw)
In-Reply-To: <50D0453D.4090409@dallaway.org.uk>

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

  reply	other threads:[~2012-12-18 11:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-17 17:25 [ECOS] " Bernd Schuster
2012-12-17 19:01 ` [ECOS] " John Dallaway
2012-12-17 21:04   ` Bernd Schuster
2012-12-18  8:39     ` Bernd Schuster
2012-12-18  8:45       ` Bernd Schuster
2012-12-18 10:28     ` John Dallaway
2012-12-18 11:56       ` Bernd Schuster [this message]
2012-12-18 12:09       ` Bernd Schuster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121218115648.274280@gmx.net \
    --to=schuster_bernd@gmx.net \
    --cc=ecos-discuss@ecos.sourceware.org \
    --cc=john@dallaway.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).