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 23:59:00 -0000 [thread overview]
Message-ID: <49C973EE.8060702@tensilica.com> (raw)
In-Reply-To: <20090324203953.GA309@caradoc.them.org>
Daniel Jacobowitz wrote:
>On Tue, Mar 24, 2009 at 01:32:57PM -0700, Ross Morley wrote:
>
>
>>>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?
>>
>>
>
>No, I was saying the opposite.
>
Sorry for the misunderstanding.
>Sometimes it will still be expensive
>to implement the protocol extension.
>
I would think that in most cases the stub already knows something
about what's going on, be it a single-step trap, a data watchpoint
match, or a breakpoint. It already has to distinguish some of those
cases. In many if not most cases the stub gets an exception directed
to a certain vector, an indication in a status register, or some other
clue as to the nature of the stop. It doesn't need to distinguish
types of break instruction except for size (if there's more than one).
It also needn't distinguish GDB planted breaks from program breaks.
If a target finds it's too expensive to implement the remote protocol
extension, then that target can have GDB probe the instruction.
>I'm interested in whether anyone
>sees an approach that does not require instruction scanning.
>
>
I suspect it's going to be very target and arch specific.
>GDB has the option to cheat - it can consult the program (ELF file),
>separately from the target's view of memory. This would not work for
>stray breakpoints inserted in the program at runtime, though.
>
>
Not always. Program breaks are often very useful in situations where
you have code embedded in a ROM and no ELF file available. We put them
in exception handlers to allow a debugger to get control when certain
exceptions happen.
I do agree it would be good to hear if anyone has any other ideas.
Thanks,
Ross
next prev parent reply other threads:[~2009-03-24 23:59 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 ` RFC: Program Breakpoints Ross Morley
2009-03-24 20:40 ` 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 [this message]
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=49C973EE.8060702@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