Linux PARISC architecture development
 help / color / mirror / Atom feed
From: John Marvin <jsm@udlkern.fc.hp.com>
To: parisc-linux@puffin.external.hp.com
Subject: Re: Single-stepping
Date: Sun, 19 Nov 2000 22:43:02 -0700 (MST)	[thread overview]
Message-ID: <200011200543.WAA23694@udlkern.fc.hp.com> (raw)

> > Note that this is the short explanation. It is not as simple as it sounds.
> > One major complication is that branches with links don't work properly
> > with the instruction queue magic, so the link register has to be updated
> > in the taken branch trap handler. Also branch externals won't update
> > the space of the space queue tail properly (again, that has to be fixed
> > in the taken branch handler). I can provide more details if the recovery
> > counter method doesn't work out.
>
> I'm a little intrigued about these "complications".  How can the link
> register or space _not_ be updated properly?  As far as I can see, the
> only really tricky instruction to single-step is RFI - which shouldn't
> ever occur in userspace, and which we'd just emulate if it was important.

The problem is that the link register is set to IAOQ_Back + 4. and in
the case of ble, sr0 is set to IASQ_Back. Since we've played games with
the queues, IAOQ_Back and IASQ_Back are pointing at the break page, not
at the instruction following the branch.

The additional complication is that the taken branch trap traps at the
branch destination, not at the branch, so at the point of the trap you
don't know where you came from in order to fix the problem easily.  So,
what HP-UX does is check each instruction before it executes it to see if
it is a branch, and if so, what the link register is (and that is all that
needs to be parsed, since we are not emulating the instruction).  It then
stores the branch location, and also sets some branch state flags (e.g.
UBE for a branch external, and UBL for a branch with a link, both flags
being set for a ble instruction).  Then in the taken branch handler you
have all the information you need to fix the queue.  You also need
to check this saved state if a signal handler is invoked while single
stepping, so that the proper pc queue values can be saved in the signal
context.

John Marvin
jsm@fc.hp.com

             reply	other threads:[~2000-11-20  5:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-20  5:43 John Marvin [this message]
2000-11-20  6:53 ` Single-stepping Alan Modra
2000-11-20  7:24   ` Single-stepping Stan Sieler
2000-11-20  9:05     ` Single-stepping Alan Modra
2000-11-20 18:47       ` Single-stepping Stan Sieler
  -- strict thread matches above, loose matches on Subject: below --
2000-11-16 12:44 Single-stepping John Marvin
2000-11-16 13:20 ` Single-stepping Richard Hirst
2000-11-16 19:00 ` Single-stepping Frank Rowand
2000-11-16 20:28   ` Single-stepping Richard Hirst
2000-11-16  9:01 Single-stepping John Marvin
2000-11-16 12:00 ` Single-stepping Richard Hirst
2000-11-20  3:03 ` Single-stepping Alan Modra

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=200011200543.WAA23694@udlkern.fc.hp.com \
    --to=jsm@udlkern.fc.hp.com \
    --cc=parisc-linux@puffin.external.hp.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