Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Debug Problem (using YAGARTO tool chain)
PostPosted: Thu Mar 17, 2011 11:45 pm 
Offline

Joined: Fri Feb 01, 2008 12:29 am
Posts: 18
Hello,
I've got a problem I've sunk about 9 hours into solving and haven't gotten anywhere, so thought the smart people here might be able to help me.

I've been working a project for many months now, no problem with debugger. All of a sudden yesterday, when I went to debug (after stepping through a few instructions) I get the following error: "Dwarf Error: Cannot find DIE at 0x848 referenced from DIE at 0x631 [in module {project path}\main.out]". What's really weird is I can arbitrarily remove a chunk of code, and then I can debug just fine, or get a different error. For instance, sometimes the debugger will work fine in all code modules except for main.c, where I can't even set breakpoints. Other times, arm-elf-gdb.exe just crashes as soon as I try to debug. Any yet other times, I get a message box as soon as the debugger starts saying "Error stopping at main. Reason: Target request failed: No symbol table is loaded. Use the "file" command.. Continue?". Which error I get depends on how many lines of code i comment out. And as mentioned, it's totally arbitrary code that I comment out - from any module.

Is it possible that I'm hitting some sort of code size limitation that the debugger or linker (when producing main.out) may have? My binary file that i download to flash is 61372 bytes in size, and I'm running on a AT91SAM7X512. Also, programming the device and running the code works just fine - only have these problems with the debugger.

Any ideas???


Top
 Profile  
 
 Post subject: Re: Debug Problem (using YAGARTO tool chain)
PostPosted: Fri Mar 18, 2011 1:57 am 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
Well Dwarf is a debug symbol format, and other places it's complaining about no symbols.
This sounds likes either a file format error (generation/linker), or parsing error (loading/debugger). The fact you can add/remove code and alter the pass/fail of the debugger, suggests some size/boundary condition in one or more structure or table.

You'd have to examine the main.o ELF object, perhaps with objdump or similar tool and see if you can isolate any structural differences between passing/failing objects. Look at the final executable too.

You might also want to check your compiler/linker command line options, and perhaps optimization or debug level settings.

You could attach objects/executables here for me to analyze, or mail me at CptTitanic at gmail dot com.


Top
 Profile  
 
 Post subject: Re: Debug Problem (using YAGARTO tool chain)
PostPosted: Mon Mar 21, 2011 8:03 pm 
Offline

Joined: Fri Feb 01, 2008 12:29 am
Posts: 18
Thanks for the feedback. I've taken a look at main.dmp (main.out processed through objdump), and of course there are some differences, but I don't understand the format well enough to pinpoint possible problems.

If you could take a look, I've attached two zip files with the .bin, .dmp, .map, and .out files. The failing one is my full project, where I get the error “Error stopping at main. Reason: Target request failed: No symbol table is loaded.” The second zip is the exact same project with just eight lines of code arbitrarily removed from the RegisterAccessRequest_Time() function. It debugs just fine.

Here are the lines of my makefile used to build the project:

CC = arm-elf-gcc
AS = arm-elf-as
LD = arm-elf-ld -v
CP = arm-elf-objcopy
OD = arm-elf-objdump

CFLAGS = -mcpu=arm7tdmi -I./ -c -fno-common -O0 -g -fomit-frame-pointer -Wcast-align
ASFLAGS = -mapcs-32 -g
LFLAGS = -omain.out -T$(CMD_FILE) -Map main.map --cref
CPFLAGS = --output-target=binary
ODFLAGS = -x --syms

OBJECTS = crt.o main.o isrsupport.o lowlevelinit.o ADC.o ADC_External.o Control.o Flash.o Globals.o Host_Comm.o I2C.o Peripherals.o SPI.o SPI_Slave.o Timers.o Tracing.o

all: main.out
@ echo "...Creating Binary File"
$(CP) $(CPFLAGS) main.out main.bin
@echo "... Creating Dump File"
$(OD) $(ODFLAGS) main.out > main.dmp
@ echo "Make Finished Successfully!"

main.out: $(OBJECTS)
@ echo "...linking"
$(LD) $(LFLAGS) -omain.out $(OBJECTS) libgcc.a

Thank you for your suggestions, and I greatly appreciate any light you can shed on this!!


Attachments:
File comment: Debug fails with error: “Error stopping at main. Reason: Target request failed: No symbol table is loaded.”
Debug_Failed.zip [79.43 KiB]
Downloaded 9 times
File comment: Debugging works properly
Debug_Success.zip [79.3 KiB]
Downloaded 9 times
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: