[En-Nut-Discussion] generating .elf files for debugging

José Vallet jose.vallet at hut.fi
Fri Jan 27 16:09:02 CET 2006


Hello.

I am trying to debug my code, so I am trying to tell the avr-gcc to 
include debugging information.

My application lives under nutapp/PEM directory

What I do is to include the line
HDEF += -g3 -gdwarf-2 -O0

in the file nutapp/UserConf.mk
after make all (or make myaplication.elf), I cannot see anywhere any of 
the above options as input to avr-gcc during the compilation/linking 
process, and when I feed the .elf to AVR Studio it complains that: "The 
object file does not contain source code information". Insight complains 
about the same issue.

Also I tryed to put that line at UserConf.mk living at nutbld, but 
didn't work either. And finally I tried also to include that line in the 
makefile straight, but didn't work either.

Can somebody tell me what to put and where so the source code 
information is included in the elf and I can debug my application?

Thanks!



Here I put the make process output just in case...
----------------------------------------------------------------------
$ make pemctrl.elf
avr-gcc -c -mmcu=atmega128 -Os -fno-delete-null-pointer-checks -Wall 
-Wstrict-prototypes -Wa,-ahlms=pemctrl.lst -DETHERNUT2 
-D__HARVARD_ARCH__ -Ic:/ethernut-4.0.1/nutbld/include 
-Ic:/ethernut-4.0.1/nut/include  pemctrl.c -o pemctrl.o
In file included from pemctrl.c:45:
pem_httpd.c: In function `DataServer':
pem_httpd.c:711: warning: unused variable `adc_value'
avr-gcc -c -mmcu=atmega128 -Os -fno-delete-null-pointer-checks -Wall 
-Wstrict-prototypes -Wa,-ahlms=xflash.lst -DETHERNUT2 -D__HARVARD_ARCH__ 
-Ic:/ethernut-4.0.1/nutbld/include  -Ic:/ethernut-4.0.1/nut/include 
xflash.c -o xflash.o
avr-gcc -c -mmcu=atmega128 -Os -fno-delete-null-pointer-checks -Wall 
-Wstrict-prototypes -Wa,-ahlms=tftp.lst -DETHERNUT2 -D__HARVARD_ARCH__ 
-Ic:/ethernut-4.0.1/nutbld/include  -Ic:/ethernut-4.0.1/nut/include 
tftp.c -o tftp.o
avr-gcc -c -mmcu=atmega128 -Os -fno-delete-null-pointer-checks -Wall 
-Wstrict-prototypes -Wa,-ahlms=pbtwique.lst -DETHERNUT2 
-D__HARVARD_ARCH__ -Ic:/ethernut-4.0.1/nutbld/include 
-Ic:/ethernut-4.0.1/nut/include  pbtwique.c -o pbtwique.o
avr-gcc -c -mmcu=atmega128 -Os -fno-delete-null-pointer-checks -Wall 
-Wstrict-prototypes -Wa,-ahlms=PemBoard.lst -DETHERNUT2 
-D__HARVARD_ARCH__ -Ic:/ethernut-4.0.1/nutbld/include 
-Ic:/ethernut-4.0.1/nut/include  PemBoard.c -o PemBoard.o
avr-gcc -c -mmcu=atmega128 -Os -fno-delete-null-pointer-checks -Wall 
-Wstrict-prototypes -Wa,-ahlms=PbDebug.lst -DETHERNUT2 
-D__HARVARD_ARCH__ -Ic:/ethernut-4.0.1/nutbld/include 
-Ic:/ethernut-4.0.1/nut/include  PbDebug.c -o PbDebug.o
avr-gcc pemctrl.o  xflash.o tftp.o pbtwique.o PemBoard.o PbDebug.o 
-mmcu=atmega128 -Wl,--defsym=main=0,-Map=pemctrl.map,--cref 
-Lc:/ethernut-4.0.1/nutbld/lib c:/ethernut-4.0.1/nutbld/lib/nutinit.o 
-lnutarch -lnutnet -lnutpro -lnutfs -lnutos -lnutdev -lnutnet -lnutcrt 
-o pemctrl.elf




More information about the En-Nut-Discussion mailing list