[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] GDB gets line numbers wrong. Help!
From: |
Scott Finneran |
Subject: |
[avr-gcc-list] GDB gets line numbers wrong. Help! |
Date: |
Wed, 28 Nov 2001 17:29:37 +1100 |
Hello everyone,
Apologies if this seems a little off-topic. I am currently experiencing
a problem with gdb-5.0 (patched for the AVR). It seems that GDB is
unable to correctly align program space addresses with source lines.
Running with -O0 does of course help a little but certainly does not fix
the problem entirely.
We are not talking about minor errors either. Quite often, GDB will say
that a program address corresponds to a line number > the length of the
source file. This also occurs regardless of whether the source contains
C or C++ or a combination of the two.
Even some help determining if the fault lies in GCC/G++ producing the
elf files or in GDB reading them would be greatly appreciated.
(avr-objdump isn't really appropriate for this as it may contain the
same bug!)
In case my mistake lies in a selection of my cmd-line args, source file
compilations look like this:
cook: avr-gcc -I./library/hdr -Ibl/library/hdr -Iblbl/library/hdr
-Iblblbl/library/hdr -I/usr/local/include -I. -Ibl -Iblbl -Iblblbl
-I./flasher/hdr -Ibl/flasher/hdr -Iblbl/flasher/hdr
-Iblblbl/flasher/hdr -I./ucosii/hdr -Ibl/ucosii/hdr -Iblbl/ucosii/hdr
-Iblblbl/ucosii/hdr -I/usr/local/avr/include -D__AVR_ATmega128__
-DOS_UCOSII -Wa,-gstabs -mmcu=atmega128 -g -O0 -Wall -Werror
-save-temps -c flasher/src/main.c
-Wa,-ahl=flasher/src/ATmega128-ucos/main.lst -o
flasher/src/ATmega128-ucos/main.o
...and linker command-line looks like this:
cook: avr-g++ -Wl,--cref -mmcu=atmega128 --verbose -t -fno-rtti
-fno-exceptions
-T flasher/script/avrmega128.x -L./ucosii/ATmega128-ucos
-Lbl/ucosii/ATmega128-ucos -Lblbl/ucosii/ATmega128-ucos
-Lblblbl/ucosii/ATmega128-ucos -L./avr/ATmega128-ucos
-Lbl/avr/ATmega128-ucos -Lblbl/avr/ATmega128-ucos
-Lblblbl/avr/ATmega128-ucos -L./ucosii/ATmega128-ucos
-Lbl/ucosii/ATmega128-ucos -Lblbl/ucosii/ATmega128-ucos
-Lblblbl/ucosii/ATmega128-ucos -L./library/ATmega128-ucos
-Lbl/library/ATmega128-ucos -Lblbl/library/ATmega128-ucos
-Lblblbl/library/ATmega128-ucos -L./smartcpp/ATmega128-ucos
-Lbl/smartcpp/ATmega128-ucos -Lblbl/smartcpp/ATmega128-ucos
-Lblblbl/smartcpp/ATmega128-ucos -L/usr/local/avr/lib/avr5
/usr/local/avr/lib/avr5/crtm128.o flasher/src/ATmega128-ucos/main.o
-lavr -lucosii -llibrary -lsmartcpp -lucosii -lavr -lucosii -llibrary
-lsmartcpp -lc -lgcc -nostdlib
-Wl,-Map,bin/flasher/ATmega128-ucos/rom.map
-obin/flasher/ATmega128-ucos/rom.elf
Thanks in advance,
Scott
- [avr-gcc-list] GDB gets line numbers wrong. Help!,
Scott Finneran <=