public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@wdc.com>
To: "Metzger, Markus T" <markus.t.metzger@intel.com>
Cc: Simon Marchi <simark@simark.ca>,
	Shahab Vahedi <shahab.vahedi@gmail.com>,
	 Luis Machado <luis.machado@linaro.org>,
	 "gdb@sourceware.org" <gdb@sourceware.org>,
	 Shahab Vahedi <shahab@synopsys.com>
Subject: RE: Why enforcing sw_breakpoint_from_kind() implementation in GDBserver targets
Date: Thu, 18 Jun 2020 12:03:46 +0100 (BST)	[thread overview]
Message-ID: <alpine.LFD.2.21.2006181154170.9519@redsun52.ssa.fujisawa.hgst.com> (raw)
In-Reply-To: <DM5PR11MB1690C0123E387EE96BBD4FC1DE9B0@DM5PR11MB1690.namprd11.prod.outlook.com>

Hi Markus,

> > > That's the only kind of breakpoint this architecture supports.  As far as I
> > understand,
> > > the kind is per-target and used to distinguish different kinds of breakpoints
> > supported
> > > by this target.
> > 
> >  From your description I infer you do have different kinds of breakpoints,
> > one (or more?) for each instruction.
> 
> OK, one could view it that way that we have a separate breakpoint instruction
> for each instruction/operand combination.
> 
> I rather view it as a bit inside every instruction.

 Sure, that's fine, especially from the hardware's point of view.  However 
for the purpose of the RSP abstraction I think my alternative point of 
view does make sense.

> > > The points I was trying to make is that we're also using gdbarch breakpoints
> > and that
> > > in order to use z packets, we'd need insert_point() to be able to store shadow
> > copies.
> > > I have not looked into that since gdbarch breakpoints worked for me and would
> > also
> > > allow sharing the code between a native target and gdbserver.
> > 
> >  Why do you need to store any copy in `gdbserver'?  GDB keeps a record of
> > replaced instructions, so you can use it instead.  Just send the original
> > instruction as the breakpoint kind.
> 
> The breakpoint kind would depend on the ISA.  And we'd have a real lot of them.

 Well, that's just one interpretation.  The breakpoint kind is really a 
generic cookie each target is free to give any interpretation to.  There 
is no processing of this data I know of in common GDB or `gdbserver' code.

> I don't think that we'd want to encode the original instruction in the breakpoint
> kind.  That's what the shadow copy inside the breakpoint object is for.

 I thought you wrote you had had to choose not to use `z0'/`Z0' packets 
due to the inability to utilise the breakpoint bits this way.  Maybe I got 
this wrong.

  Maciej

  reply	other threads:[~2020-06-18 11:03 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-10 17:47 Shahab Vahedi
2020-06-11  3:05 ` Simon Marchi
2020-06-11  9:40   ` Shahab Vahedi
2020-06-11 10:35     ` Luis Machado
2020-06-11 11:00       ` Shahab Vahedi
2020-06-11 11:44         ` Shahab Vahedi
2020-06-12 11:04           ` Aktemur, Tankut Baris
2020-06-15 10:39             ` Shahab Vahedi
2020-06-16 13:15               ` Aktemur, Tankut Baris
2020-06-17 21:31                 ` Shahab Vahedi
2020-06-17 22:20                   ` Luis Machado
2020-06-11 14:51         ` Simon Marchi
2020-06-15  8:54           ` Metzger, Markus T
2020-06-17  0:40             ` Maciej W. Rozycki
2020-06-18  8:11               ` Metzger, Markus T
2020-06-18  9:13                 ` Maciej W. Rozycki
2020-06-18 10:29                   ` Metzger, Markus T
2020-06-18 11:03                     ` Maciej W. Rozycki [this message]
2020-06-18 11:11                       ` Metzger, Markus T
2020-06-11 21:21 ` Martin Simmons

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=alpine.LFD.2.21.2006181154170.9519@redsun52.ssa.fujisawa.hgst.com \
    --to=macro@wdc.com \
    --cc=gdb@sourceware.org \
    --cc=luis.machado@linaro.org \
    --cc=markus.t.metzger@intel.com \
    --cc=shahab.vahedi@gmail.com \
    --cc=shahab@synopsys.com \
    --cc=simark@simark.ca \
    /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).