public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Jonathan Larmour <jlarmour@redhat.com>
To: Mark Salter <msalter@redhat.com>
Cc: ecos-discuss@sourceware.cygnus.com
Subject: Re: [ECOS] gdb 'next' problem with i386 HAL
Date: Wed, 05 Sep 2001 14:16:00 -0000	[thread overview]
Message-ID: <3B969616.52A9083A@redhat.com> (raw)
In-Reply-To: <200109051633.f85GXuN30119@deneb.localdomain>

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.

The correct SP simply cannot come out of any value on the stack. If you are
getting the correct SP, then I don't know how. When __default_exception_vsr
is called, SP will already be 16 bytes further down before the VSR handler
has had a chance to do the pusha - because the CPU has saved stuff on the
stack and the trampoline has saved the vector number, adding up to 16
bytes. You have to re-adjust it manually within the Hal_SavedRegisters
structure. I would imagine it's only after that point that (subject to
HAL_USE_INTERRUPT_STACK configury) you'll be able to switch stacks and do
anything to pop values off the application stack.

NB if you're playing in this area, be aware of any ramifications of
hal_fpu_push_int_annex when doing lazy FPU switching. You may not be using
that code in the configuration you are using.

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

  reply	other threads:[~2001-09-05 14:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-29  6:42 John Gumb
2001-08-29  6:47 ` Mark Salter
2001-09-05  8:32   ` Jonathan Larmour
2001-09-05  8:44     ` Mark Salter
2001-09-05  8:55       ` Jonathan Larmour
2001-09-05  9:33         ` Mark Salter
2001-09-05 14:16           ` Jonathan Larmour [this message]
2001-09-05 14:59             ` Mark Salter
2001-09-05 15:17               ` Jonathan Larmour
  -- strict thread matches above, loose matches on Subject: below --
2001-08-24  7:19 Patrick O'Grady
2001-08-23  2:54 John Gumb
2001-08-22 12:20 Allan Young
2001-08-15 15:08 John Gumb
2001-08-16  6:44 ` Jonathan Larmour
2001-08-17  0:31   ` Boris V. Guzhov
2001-08-17  6:17     ` Jonathan Larmour

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3B969616.52A9083A@redhat.com \
    --to=jlarmour@redhat.com \
    --cc=ecos-discuss@sourceware.cygnus.com \
    --cc=msalter@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).