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]

Line number weirdness (arm-none-eabi-gdb)


Hi all,

I'm confused about the behavior of my arm-none-eabi-gdb. The snippet below shows that when I "p" the version of a symbol I get one value and GDB apparently doesn't know the line number information for that symbol. When I set a breakpoint on that symbol GDB tells me that it set the breakpoint at a location a little farther than the nominal value for that symbol (0x2b842 vs. 0x2b830). When I ask GDB to list the lines for the value I got from the breakpoint I actually get line numbers and everyone's happy.

Note that this is ARM code in Thumb mode and GDB correctly disassembles the Thumb instructions so it doesn't appear to be confused about the ARM mode.

When I dump the info with readelf there are no apparent errors.

Anyone know why this happens and any way to prevent it? I should admit that the code was not compiled with gcc but with the GreenHills ARM compiler with DWARF2 debug info enabled.

This happens in version 7 of GDB as well as older versions.

Thanks,
Andrew Queisser


(gdb) p LIB_GPIO_init
$2 = {void ()} 0x2b830 <LIB_GPIO_init>
(gdb) l LIB_GPIO_init
No line number known for LIB_GPIO_init.
(gdb) break LIB_GPIO_init
Breakpoint 2 at 0x2b842: file /work/queisser/quasar/components2/hw/src/lib_gpio/src/lib_gpio.c, line 66.
(gdb) l *0x2b842
0x2b842 is in LIB_GPIO_init (/work/queisser/quasar/components2/hw/src/lib_gpio/src/lib_gpio.c:66).
61????????? uint16 rev;
62????????? /* Initialize the gpio and gpio_num fields of each record */
63????????? for (i=0; i<NUM_GPIOS; i++)
64?? ???????{
65????????????? _gpio_info[i].info.gpio = (lib_gpio_line_t)i;
66????????????? _gpio_info[i].info.gpio_num = -1;
67????????? }
68
69????? #if 0 // REVISIT : Ram - Need to get the board revision
70????????? rev = BOARD_ID_NUM(NOS_INIT_board_id());





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