Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Mathieu Lacage <Mathieu.Lacage@sophia.inria.fr>
To: Daniel Jacobowitz <drow@false.org>
Cc: gdb@sourceware.org
Subject: Re: help string for "break" command
Date: Fri, 12 Jan 2007 14:20:00 -0000	[thread overview]
Message-ID: <1168611571.2789.53.camel@garfield.inria.fr> (raw)
In-Reply-To: <20070112134932.GA21726@nevyn.them.org>

On Fri, 2007-01-12 at 08:49 -0500, Daniel Jacobowitz wrote:
> On Fri, Jan 12, 2007 at 02:45:16PM +0100, Mathieu Lacage wrote:
> > Am I right in assuming that the gdb command "break" places exclusively
> > so-called software-breakpoints while the command "hbreak" places a
> > hardware-breakpoint (I am not sure I have figured out the details of the
> > logic in gdb/breakpoint.c) ? 
> 
> Not 100%.  CVS versions of GDB will use hardware breakpoints
> automatically if you try to set them in truly read-only memory.

I see the following comment in the CVS version:
          /* If the explicitly specified breakpoint type
             is not hardware breakpoint, check the memory map to see
             if the breakpoint address is in read only memory or not.
             Two important cases are:
             - location type is not hardware breakpoint, memory
             is readonly.  We change the type of the location to
             hardware breakpoint.
             - location type is hardware breakpoint, memory is read-write.
             This means we've previously made the location hardware one, but
             then the memory map changed, so we undo.

             When breakpoints are removed, remove_breakpoints will
             use location types we've just set here, the only possible
             problem is that memory map has changed during running program,
             but it's not going to work anyway with current gdb.  */

and it seems to match the decision logic I see below.

Would there be opposition to an 'sbreak' command which would ensure that
a software breakpoint is used _all the time_ ? 

Mathieu
-- 


  reply	other threads:[~2007-01-12 14:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-12 11:42 placing a breakpoint at a physical address on x86 with gdb Mathieu Lacage
2007-01-12 12:48 ` Mathieu Lacage
2007-01-12 13:46   ` help string for "break" command Mathieu Lacage
2007-01-12 13:49     ` Daniel Jacobowitz
2007-01-12 14:20       ` Mathieu Lacage [this message]
2007-01-12 14:26         ` Daniel Jacobowitz
2007-01-12 14:27         ` Bob Rossi
2007-01-12 14:34           ` Mathieu Lacage
2007-01-12 18:11       ` mathieu lacage
2007-01-12 23:26         ` 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=1168611571.2789.53.camel@garfield.inria.fr \
    --to=mathieu.lacage@sophia.inria.fr \
    --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