Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Ross Morley <ross@tensilica.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb@sourceware.org
Subject: Re: RFC: Program Breakpoints
Date: Tue, 24 Mar 2009 20:33:00 -0000	[thread overview]
Message-ID: <49C94379.3020206@tensilica.com> (raw)
In-Reply-To: <20090324165732.GA7928@caradoc.them.org>

Daniel Jacobowitz wrote:

>On Mon, Mar 23, 2009 at 09:50:30AM -0700, Ross Morley wrote:
>  
>
>>It was interesting to see the matter of skipping permanent breakpoints
>>come up on this list. This is very similar to an issue we dealt with
>>a couple of years ago with Xtensa and remote targets. Our solution
>>has been stable for at least two years, but has not yet been prepared
>>for submission because I've had higher priorities (and at that time we
>>were way out of sync with mainline GDB). The issue is actually more
>>complicated than the forgoing discussion suggests.
>>
>>I'd like to discuss it here and present our solution. I'll attach a
>>patch for our current solution relative to GDB 6.8, but I do propose
>>to revise it to improve some areas based on our experience (in the
>>next few weeks) - I'll discuss that toward the end of this post.
>>    
>>
>
>I read through this; overall, it looks sane.  On some targets
>implementing this would require the remote stub to read from pc
>anyway; that's faster than GDB doing it, but not necessarily much
>faster.  But on some other targets the stub has to do this anyway,
>or can pipeline it with other necessary operations, so it's not a big
>loss.
>  
>

I think you're saying it's not a big deal performance-wise to do this
without a remote protocol extension. Is that correct?

I think it's quite possible to implement the target-specific macro
STOPPED_BY_PROGRAM_BREAKPOINT(size) without any help from the remote
protocol. That is certainly an option, and might be the method of
choice for non-remote targets and some remote targets.

Having the remote stub do the break detection has other benefits.
It removes the burden of parsing the set of possible instructions
that *might* cause a stop, from GDB, and lets the stub (which has
already decided to signal a stop) simply tell GDB why it stopped.
It also handles cases where the stub decides whether to stop or not
based on factors beyond the instruction itself. Seems cleaner and
more robust. In general I think SIGTRAP is too overloaded in GDB
which has to jump through hoops to figure out why it stopped.

What I'm hoping to get from this RFC is whether the community would
accept this method, or whether it would rather take another approach
(before I put in more effort to simplify our solution and submit it).
We'd like to have a solution that we don't have to keep merging. :-)
I'll wait a few more days in case others have something to say.

Thanks,
Ross


  reply	other threads:[~2009-03-24 20:33 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-16 17:41 [RFC] stepping over permanent breakpoint Aleksandar Ristovski
2009-03-16 18:22 ` Pedro Alves
2009-03-16 18:55   ` Aleksandar Ristovski
2009-03-16 19:38     ` Pedro Alves
2009-03-16 20:37       ` Aleksandar Ristovski
2009-03-16 18:50 ` Mark Kettenis
2009-03-16 19:04   ` Aleksandar Ristovski
2009-03-23 16:50 ` RFC: Program Breakpoints (was: [RFC] stepping over permanent breakpoint) Ross Morley
2009-03-24 16:57   ` Daniel Jacobowitz
2009-03-24 20:33     ` Ross Morley [this message]
2009-03-24 20:40       ` RFC: Program Breakpoints Daniel Jacobowitz
2009-03-24 23:48         ` Pedro Alves
2009-03-25  7:58           ` Mark Kettenis
2009-03-25 13:17             ` Pedro Alves
2009-03-24 23:59         ` Ross Morley
2009-03-31  0:44   ` Ross Morley
2009-03-31  3:17     ` Daniel Jacobowitz

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=49C94379.3020206@tensilica.com \
    --to=ross@tensilica.com \
    --cc=drow@false.org \
    --cc=gdb@sourceware.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