* Gdb shows wrong line numbers for the sourcecode
@ 2011-06-20 17:40 Josef Wolf
2011-06-20 18:31 ` Paul Koning
0 siblings, 1 reply; 3+ messages in thread
From: Josef Wolf @ 2011-06-20 17:40 UTC (permalink / raw)
To: gdb
Hello,
I have built a toolchain for ARM Cortex-M3 based on
binutils-2.20
gcc-4.4.3
gdb-6.0
openocd-0.4.0
With this combination, gdb shows wrong line numbers and wrong lines in the
source listings and in the backtrace like this:
(gdb) bt
#0 0x080004a6 in main (argc=536891392, argv=0x20005000) at main.c:45
(gdb) cont
Continuing.
Breakpoint 2, 0x080003a4 in send_char (ch=19 '\023') at main.c:45
45 while (RCC_GetFlagStatus (RCC_FLAG_PLLRDY) == RESET) {
(gdb) bt
#0 0x080003a4 in send_char (ch=19 '\023') at main.c:45
#1 0x080004ca in main (argc=536891392, argv=0x20005000) at main.c:45
In reality, the main function begins at line 91 and the send_char function
begins at line 84. The source code line shown at the breakpoint is a totally
different function.
Any ideas what could cause gdb to get confused?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Gdb shows wrong line numbers for the sourcecode
2011-06-20 17:40 Gdb shows wrong line numbers for the sourcecode Josef Wolf
@ 2011-06-20 18:31 ` Paul Koning
2011-06-21 15:50 ` Josef Wolf
0 siblings, 1 reply; 3+ messages in thread
From: Paul Koning @ 2011-06-20 18:31 UTC (permalink / raw)
To: Josef Wolf; +Cc: gdb
Probably the fact that your GDB is an antique.
I found that a version of GDB not nearly so out of date was unuseable with current GCC. Updated to the current (7.2) and all is well.
paul
On Jun 20, 2011, at 1:39 PM, Josef Wolf wrote:
> Hello,
>
> I have built a toolchain for ARM Cortex-M3 based on
>
> binutils-2.20
> gcc-4.4.3
> gdb-6.0
> openocd-0.4.0
>
> With this combination, gdb shows wrong line numbers and wrong lines in the
> source listings and in the backtrace like this:
>
> (gdb) bt
> #0 0x080004a6 in main (argc=536891392, argv=0x20005000) at main.c:45
> (gdb) cont
> Continuing.
>
> Breakpoint 2, 0x080003a4 in send_char (ch=19 '\023') at main.c:45
> 45 while (RCC_GetFlagStatus (RCC_FLAG_PLLRDY) == RESET) {
> (gdb) bt
> #0 0x080003a4 in send_char (ch=19 '\023') at main.c:45
> #1 0x080004ca in main (argc=536891392, argv=0x20005000) at main.c:45
>
> In reality, the main function begins at line 91 and the send_char function
> begins at line 84. The source code line shown at the breakpoint is a totally
> different function.
>
> Any ideas what could cause gdb to get confused?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Gdb shows wrong line numbers for the sourcecode
2011-06-20 18:31 ` Paul Koning
@ 2011-06-21 15:50 ` Josef Wolf
0 siblings, 0 replies; 3+ messages in thread
From: Josef Wolf @ 2011-06-21 15:50 UTC (permalink / raw)
To: gdb
On Mon, Jun 20, 2011 at 02:31:11PM -0400, Paul Koning wrote:
> Probably the fact that your GDB is an antique.
>
> I found that a version of GDB not nearly so out of date was unuseable with current GCC. Updated to the current (7.2) and all is well.
ARGH!
Thanks for the hint, Paul!
Actually, I _had_ built gdb-7.2. But after that, I built insight-6.8-1 (that's
the latest available version of insight, AFAIK). And insight installed the old
gdb over the new one :-/ (that I wrote 6.0 instead of 6.8 was just a typo).
Now I kicked insight 6.8-1 into the trash can and rebuilt gdb-7.2 and
everything looks good so far.
Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-06-21 15:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-20 17:40 Gdb shows wrong line numbers for the sourcecode Josef Wolf
2011-06-20 18:31 ` Paul Koning
2011-06-21 15:50 ` Josef Wolf
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).