Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Randolph Chung <randolph@tausq.org>
To: Andrew Cagney <cagney@gnu.org>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [patch/RFA] multiarch INSTRUCTION_NULLIFIED
Date: Wed, 01 Dec 2004 06:19:00 -0000	[thread overview]
Message-ID: <20041201061924.GZ6359@tausq.org> (raw)
In-Reply-To: <41AB3C1D.80509@gnu.org>

> >this is not possible to do in the general case though, because, sitting
> >on the current insn at pc, you cannot necessarily determine if the 
> >next insn will be nullified or not. (in the current example, the 
> >nullification is always applied, but it can be conditional on some 
> >computation being done)
> 
> I'm not sure what you mean.  What you describe sounds like the old 
> STEP_SKIPS_DELAY logic - a test on the _next_ instruction.  The new 
> logic instead:
> 
> # Return non-zero if the processor is executing a delay slot and a
> # further single-step is needed before the instruction finishes.
> M::int:single_step_through_delay:struct frame_info *frame:frame
> 
> checks to see if the _last_ instruction put us into a delay slot.

mmm... maybe i'm not reading the code correctly, but i still don't see 
how this will work for the hppa case.

this predicate is used in two places:

in proceed(), this only applies for the first insn at a "continue" or a
"step"/"next", right? so in any case it doesn't do anything if you are 
stepping through a series of instructions and the first one is not a 
branch/delay slot insn.

in handle_inferior_event(), the condition being checked is:

  if (stop_signal == TARGET_SIGNAL_TRAP
      && trap_expected
      && gdbarch_single_step_through_delay_p (current_gdbarch)
      && currently_stepping (ecs))

trap_expected will not be set when you are doing a "step" with single
stepping. possibly this works on mips because it uses software single
step? but on hppa we have hardware single step, and as far as i can tell
trap_expected is not set as we are stepping through instructions to get
to the next line when doing a "step". this condition again seems to be
more for the case when you hit a breakpoint at a branch insn with a
delay slot and you want to determine how to single step off that branch.
in the hppa case we have no breakpoints in this case.

i experimented with another proposal which is to adjust the pc when we
are at a nullified instruction. i modified target_read_pc () to return
the previous (or next) pc when we are at a nullified instruction. this 
fixes some of the failures but causes new failures with the 
"recurse.exp" test. i need to investigate that some more. but teaching 
target_read_pc() to lie about the current pc seems to be suboptimal.

lastly a comment about sparc -- i think the sparc case is simpler
because it doesn't have conditional nullification. so looking at a
particular insn you can always determine if the next insn will be
nullified or not. this is not always the case for hppa.

randolph
-- 
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/


  parent reply	other threads:[~2004-12-01  6:19 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-18  0:02 Randolph Chung
2004-11-18 14:26 ` Andrew Cagney
2004-11-18 16:21   ` Randolph Chung
2004-11-18 16:56     ` Mark Kettenis
2004-11-19  9:25       ` Orjan Friberg
2004-11-23 17:50       ` Randolph Chung
2004-11-23 19:33         ` Mark Kettenis
2004-11-28 17:26         ` Andrew Cagney
2004-11-28 18:41           ` Randolph Chung
2004-11-28 19:55             ` Andrew Cagney
2004-11-29  3:30               ` Randolph Chung
2004-11-29 15:12                 ` Andrew Cagney
2004-11-30  6:56                   ` Randolph Chung
2004-11-30 14:51                     ` Andrew Cagney
2004-11-30 16:44                       ` Randolph Chung
2004-11-30 16:59                         ` Andrew Cagney
2004-11-30 17:38                           ` Randolph Chung
2004-12-01 21:29                             ` Andrew Cagney
2004-12-01 22:33                               ` Randolph Chung
2004-12-01 23:32                                 ` Andrew Cagney
2004-12-02  5:24                                   ` Randolph Chung
2004-12-02 14:27                                     ` Daniel Jacobowitz
2004-12-03 18:11                                     ` Andrew Cagney
2004-12-03 18:15                                       ` Randolph Chung
2004-12-03 18:57                                         ` Daniel Jacobowitz
2004-12-03 19:57                                           ` Randolph Chung
2004-12-03 21:40                                       ` Randolph Chung
2004-12-03 21:58                                         ` Andrew Cagney
2004-12-03 22:52                                           ` Daniel Jacobowitz
2004-12-04  0:00                                           ` Randolph Chung
2004-12-04  0:55                                           ` Randolph Chung
2004-12-04 11:27                                             ` Mark Kettenis
2004-12-01  6:19                   ` Randolph Chung [this message]
2004-12-01 17:11                     ` Daniel Jacobowitz
2004-12-01 17:17                       ` Randolph Chung
2004-12-01 17:19                         ` Daniel Jacobowitz
2004-12-01 17:25                           ` Randolph Chung
2004-12-01 17:28                             ` Daniel Jacobowitz
2004-12-01 17:30                               ` Randolph Chung
2004-12-01 17:35                               ` Randolph Chung
2004-12-01 18:14                                 ` Randolph Chung
2004-12-01 21:25                       ` Andrew Cagney
2004-12-01 13:32 Paul Schlie
2004-12-01 16:25 Randolph Chung

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=20041201061924.GZ6359@tausq.org \
    --to=randolph@tausq.org \
    --cc=cagney@gnu.org \
    --cc=gdb-patches@sources.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