Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb@sourceware.org
Cc: Daniel Jacobowitz <drow@false.org>,  Ross Morley <ross@tensilica.com>
Subject: Re: RFC: Program Breakpoints
Date: Tue, 24 Mar 2009 23:48:00 -0000	[thread overview]
Message-ID: <200903242348.22395.pedro@codesourcery.com> (raw)
In-Reply-To: <20090324203953.GA309@caradoc.them.org>

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.

-- 
Pedro Alves


  reply	other threads:[~2009-03-24 23:48 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 [this message]
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=200903242348.22395.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=drow@false.org \
    --cc=gdb@sourceware.org \
    --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