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]

Re: gdb 'next' problem with i386 HAL


Mark Salter wrote:
> 
> >>>>> John Gumb writes:
> 
> > The problem only occurs when 'nexting' over a function call. 
[snip] 
> > The trouble is, the return address isn't there. I had a poke around and it actually is 16 bytes further down the stack. [snip]
> 
> I think this is a problem in the HAL code. The HAL is passing
> the wrong SP value to GDB. The problem is that the HAL stub
> uses the same stack as the app being debugged. The HAL should
> be switching to a dedicated GDB stub stack.

Actually the problem is that on the x86 16 bytes automatically get saved on
the stack by the CPU before we have a chance to do anything about it. The
solution is to adjust the SP stored by the __default_exception_vsr into the
HAL_Saved_Registers struct by 16.

I'll check something in to hopefully fix it that should be in anon cvs some
time soon.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine


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