This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: debugger output on arm-elf target


Jan:


Debugging optimized code will always be a problem.  The optimizer
moves, reorders and sometimes completely eliminates entire source
lines of code; the result is that when you say "breakpoint main.c:30",
the answer is ambiguous.

Also, one of the optimization levels (-O3?) turns off frame pointer
generation.  This will break the debugger for sure, as it needs stack
frames to figure out what's going on.  This would lead to unstable
behavior.

Stepping assembly code with the stepi command usually works.  :^)

I've heard that anything earlier than gdb-5.1 will be unreliable for
ARM targets, and I have experienced some problems myself.  You may get
better results with >=5.1 or a CVS snapshot.

With few exceptions, you don't have to build your program with the
same optimization levels throughout.  You could always turn off
optimizations for the module or two you want to debug, and leave the
rest optimized.


HTH,


b.g.

On Tue, Apr 30, 2002 at 07:59:38AM +0200, van belle wrote:
> 	Hello all,
> 
> 	I don't know if this is a common thing on all targets of the GNU
> compiler... Anyway:
> 
> When I compile:
> 
> arm-elf-gcc -mthumb -mcpu=arm7tdmi -g3 -ggdb -o test.elf test.c
> 
> I can debug that application, step through assembler etc.
> When I add -Ox (any optimisation (0..3)), I am only able to step over it
> (a breakpoint at the start and the end of the routine, but no other
> debugging info.
> 
> I compiled the arm-elf-gcc following the script on the site of William
> A. Gatliff. What can I do to get debugging info even in the optimised
> versions of my (for now: very dumb) program??
> 
> Kind regards,
> 
> Jan
Content-Description: Card for van belle

> ------
> Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
> Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com

-- 
Bill Gatliff
bgat@billgatliff.com

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


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