This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


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: powerpc-eabi-gdb backtrace problem


On Tue, 2003-02-18 at 09:27, Jonathan Larmour wrote:
> Christoph Csebits wrote:
> > hi,
> > 
> > i am starting the twothreads example with
> > gdb 5.0 and doing a break (ctrl-c).
> > 
> > After 'bt' prints some frames i got
> > Reply contains invalid hex digit 84
> > 
> > Turning debugging on shows that gdb
> > tries to dereference 0xdeadbeef.
> > 
> > Its clear why the stub is causing
> > an exception invoking himself again
> 
> I know you've identified the stack checking as the reason, but it's not 
> really the cause (other than GDB's stack guesswork), so there's still 
> another interesting issue with this: the stub shouldn't barf. There's 
> meant to be code to catch this (see cyg_hal_exception_handler() in 
> hal/powerpc/arch/current/src/hal_misc.c - look at the stuff at the top 
> about __mem_fault_handler).
> 
> If it correctly caught the exception the backtrace would likely work using 
> GDB's admittedly ramshackle heuristics. *That's* the problem, not the 
> stack checking itself.
> 
> I'll add this to the bug.

I agree that GDB should not barf - certainly that's a problem.

However, I think that the stack checking code is breaking the
EABI and putting stuff on the stack that is, in essence, invalid.
The PowerPC ABIs really suck (thanks, IBM) in that there needs
to be some space (I don't recall how much) *above* the stack
that belongs to the current frame.  This means that the last
stack frame (the ending one, hopefully) can't have those
0xDEADBEEF markers immediately adjacent (IIRC).  

We should probably look at the ABI and make sure that what we
do with the stack for checking is legal.


-- 
.--------------------------------------------------------.
|       Mind: Embedded Linux and eCos Development        |
|--------------------------------------------------------|
| Gary Thomas              email:  gary.thomas@mind.be   |
| Mind ( http://mind.be )  tel:    +1 (970) 229-1963     |
| gpg: http://www.chez-thomas.org/gary/gpg_key.asc       |
'--------------------------------------------------------'


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


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