Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: pedro@codesourcery.com
Cc: gdb@sourceware.org, drow@false.org, ross@tensilica.com
Subject: Re: RFC: Program Breakpoints
Date: Wed, 25 Mar 2009 07:58:00 -0000	[thread overview]
Message-ID: <200903250757.n2P7vQod004081@brahms.sibelius.xs4all.nl> (raw)
In-Reply-To: <200903242348.22395.pedro@codesourcery.com> (message from Pedro 	Alves on Tue, 24 Mar 2009 23:48:21 +0000)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1712 bytes --]

> From: Pedro Alves <pedro@codesourcery.com>
> Date: Tue, 24 Mar 2009 23:48:21 +0000
> 
> On Tuesday 24 March 2009 20:39:53, Daniel Jacobowitz wrote:
> > No, I was saying the opposite.  Sometimes it will still be expensive
> > to implement the protocol extension.  I'm interested in whether anyone
> > sees an approach that does not require instruction scanning.
> 
> [ For the record, since I was curious about the  win32 bits below ]
> 
> Several OSs already export that info on their debug APIs, but we
> just discard it.
> 
> Some linux archs expose it in the SIGTRAP siginfo, in
> the si_code field, in the form of TRAP_BRKPT, TRAP_TRACE.  E.g., I think
> ppc does expose TRAP_BRKPT, but x86/x86_64 doesn't, at least not yet.
> 
> I believe mac/darwin also distinguishes breakpoint traps from
> single-stepping traps at the debug api level.  At least include/gdb/signals.h
> mentions TARGET_EXC_BREAKPOINT as being a Mach exception.  This could
> mean that GNU/Hurd also distinguishes them.
> 
> Windows distinguishes breakpoints from singlesteps at the debug API level
> too.  We have EXCEPTION_SINGLE_STEP and EXCEPTION_BREAKPOINT.  You'll
> see that windows-nat.c converts both to SIGTRAP.  I've just confirmed this,
> by enabling "set debugexceptions on" on a Cygwin GDB.
> 
> Probably other os/archs/targets have similar means to distinguish a
> breakpoint trap from a singlestep.  Either through a different trap
> vector for each case, or looking at the trace flag and at the intruction
> stream themselves, etc.

These statements are all rather i386-centric.  Especially on targets
that emulate single-stepping it may be impossible to distinguish.  GDB
should not depend on the ability to do so.


  reply	other threads:[~2009-03-25  7:58 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 [this message]
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=200903250757.n2P7vQod004081@brahms.sibelius.xs4all.nl \
    --to=mark.kettenis@xs4all.nl \
    --cc=drow@false.org \
    --cc=gdb@sourceware.org \
    --cc=pedro@codesourcery.com \
    --cc=ross@tensilica.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