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

Randolph Chung wrote:
>>If, when resuming the inferior, a double step is required, 
>>single_step_through_delay will do the job.
> 
> 
> 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.

(The MIPS code, which is technically implementing STEP_SKIPS_DELAY, 
works because when in a delay slot the PC still points at the branch 
instruction.  A fixme would be to change the mips code to instead test 
the delay-slot bit.).

>>However, that doesn't solve the case of GDB encountering a frame 
>>(inferior) that, be it through attach, cntrl-c, a signal, or a core 
>>file, is already sitting on the above nullified instruction.  The 
>>corefile case being expecially nasty - trying to get a corefile to step 
>>off a nullified instruction won't get you very far :-).  I suspect that 
>>the code will need to modify ``pc'' so that it either appears to be one 
>>instruction behind (the "bv,n") or one instruction ahead (branch 
>>destination) of what the registers indicate.
> 
> 
> oh, are you saying that:
> if we are looking at a corefile, and the current pc is sitting on a
> nullified insn that belonged to the next function, that we may not be
> able to do a backtrace correctly?

Yes, and more to the point INSTRUCTION_NULLIFIED can't help here.  On 
the other hand, if this case is made to work INSTRUCTION_NULLIFIED is 
redundant.

However, the first question is: can such a corefile be created?  Given 
that GDB can single step an inferior into such a state, I think it can.

>>It might also be useful to check the SPARC.  It has PC/NPC, delay slots, 
>>and instruction nullification, so I'd expect similar problems.
> 
> 
> ok, i'll see if i can find a sparc machine to try to reproduce this
> problem there.

One thing to check is for isif the SPARC requires padding between functions?

--

If you want, add a DEPRECATED_INSTRUCTION_NULLIFIED to the architecture 
vector and have the PA-RISC use that.  While a sideways step, it lets 
you advance what I'm assuming is the more immediate objective of 
cleaning out PA's tm*.h files and making it pure multi-arch.

Andrew


  reply	other threads:[~2004-11-29 15:12 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 [this message]
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
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=41AB3C1D.80509@gnu.org \
    --to=cagney@gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=randolph@tausq.org \
    /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