Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: "Laurent G." <vrygoud@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: Delete a watchpoint by address to automate segfault tracking
Date: Thu, 27 Sep 2012 13:39:00 -0000	[thread overview]
Message-ID: <87k3vfwpnv.fsf@fleche.redhat.com> (raw)
In-Reply-To: <CAD=JCDtHcnOozsXKrTnBiT2hhUqXARDrb2iuLDKyzb+=r5cwBw@mail.gmail.com>	(Laurent G.'s message of "Thu, 27 Sep 2012 13:42:37 +0200")

>>>>> "Laurent" == Laurent G <vrygoud@gmail.com> writes:

Laurent> In the article, the author says "I couldn’t find an easy way to track
Laurent> the memory watch number that was created during the first breakpoint,
Laurent> I just built a gdb counter, and deleted the memory watch when leaving,
Laurent> since I could predict gdb’s numbering" and implements watchpoints
Laurent> destruction this way:

I think $bpnum may hold this.
See the 'Set Breaks' node of the manual.
Or it can perhaps be done from Python.

Laurent> How can I do a "delete *`print $d`" in GDB?

A few ways.

Simplest is to use "eval".

Otherwise, Python.

Otherwise, if you have an old gdb and can't upgrade, use set logging to
write out a file with the command you want (using printf), then 'source'
the file.

Tom


  reply	other threads:[~2012-09-27 13:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-27 11:43 Laurent G.
2012-09-27 13:39 ` Tom Tromey [this message]
2012-09-28 13:32   ` Laurent G.

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=87k3vfwpnv.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb@sourceware.org \
    --cc=vrygoud@gmail.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