[coldfire-gnu-discuss] zero divide trap when running Debug Sprite Example "Fibo"
Christof Frey
Christof.Frey at varian.com
Mon Jul 7 16:59:34 UTC 2008
According to CFPRM the stack frame is two long word:
SSP -> 32 Bit control information
SSP + 0x4 -> program counter
So is the SSP pointing to 0xffffb4 below the frame of interest ?
Program received signal SIGTRAP, Trace/breakpoint trap.
0x00000d3a in __cs3_isr_divide_by_zero ()
(gdb) x/8xw $sp
0xffffb4: 0x000009a0 0x000008de 0x00000000 0x00ffffcc
0xffffc4: 0x00000e20 0x00ffffe0 0x00ffffe0 0xfffffffe
(gdb) x $sp
0xffffb4: 0x000009a0
(gdb)
-----Original Message-----
From: Nathan Sidwell [mailto:nathan at codesourcery.com]
Sent: Friday, July 04, 2008 8:44 AM
To: Mark Mitchell
Cc: Christof Frey; coldfire-gnu-discuss at codesourcery.com
Subject: Re: [coldfire-gnu-discuss] zero divide trap when running Debug Sprite Example "Fibo"
Mark Mitchell wrote:
> Christof Frey wrote:
>
>> when running the example on page 51 of the Getting Started guide on a
>> BCC5235 Coldfire board I am getting a zero divide trap.
>
> I suspect that you're actually getting some other trap; the default
> trap handlers are all mapped at the same address, so the debugger
> picks a name somewhat at random.
>
>> Is this related to the library used ? (note: the board has still the
>> Freescale dBug monitor application in flash - is there an
>> interference ?)
>
>> Program received signal SIGTRAP, Trace/breakpoint trap.
>> 0x00000d3a in __cs3_isr_divide_by_zero ()
>> (gdb)
>
> Nathan, do you have ideas about how to figure out exactly what's going
> wrong here?
you have to examine the call stack. in gdb do (something like)
x/8xw $sp
you should be able to see the exception information there and the exception address. consult the CFPRM for a description of the exception word.
It is unfortunate that gcc doesn't emit sufficient debug information on interrupt functions for this to just look like parameters (we have an internal enhancement issue for that)
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery
More information about the coldfire-gnu-discuss
mailing list