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


>>>>> Jonathan Larmour writes:

> Mark Salter wrote:
>> 
>> >>>>> Jonathan Larmour writes:
>> 
>> > So you've presumably added something to switch to the interrupt stack. Fair
>> > enough, but isn't that a separate issue? The SP value stored in the
>> > HAL_SavedRegisters is still off by 16 no matter what stack you're running
>> > on. The SP value to report to GDB must still be the value at the time of
>> > the exception, not the value just after it, no matter what.
>> 
>> I pop those values off the application stack before copying them to the
>> stub stack frame. The correct SP just comes out of that. I'm not sure
>> that simply adjusting the SP is sufficient. It may be for 'next' but
>> inferior function calls may corrupt the area under the SP passed to
>> GDB.

> I'm not saying it's _sufficient_ for inferior function calls to work. I'm
> saying it is necessary in all situations i.e. even ignoring inferior
> function calls.

Ok. And all I was saying is that I have a potential fix which doesn't just
add 16 to the SP passed to GDB, but rather fixes the SP passed to GDB as
part of a larger fix. You said you might try to fix the SP and I wanted 
to let you know that it may be wasted effort. That's all.

--Mark


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