This is the mail archive of the gdb@sourceware.org mailing list for the GDB 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]

Gdb shows wrong line numbers for the sourcecode


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?


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