Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Martin Simmons <qqxnjvamvxwx@dyxyl.com>
To: Etienne Buira <etienne.buira.lists@free.fr>
Cc: gdb@sourceware.org
Subject: Re: Feature suggestion: location conditioned watchpoint
Date: Sat, 19 Oct 2024 14:19:08 +0100	[thread overview]
Message-ID: <jea5f02ptf.fsf@localhost> (raw)
In-Reply-To: <ZxNhTDbpOE4VFdWr@Z926fQmE5jqhFMgp6> (message from Etienne Buira via Gdb on Sat, 19 Oct 2024 09:35:40 +0200)

>>>>> On Sat, 19 Oct 2024 09:35:40 +0200, Etienne Buira via Gdb said:
> 
> I tried to debug memory corruption issue with gdb, using watchpoints,
> and as the bug appeared rarely, i wish i could state "break on this
> memloc write, if it is not this known good location".
> 
> I searched the docs for conditions and convenience variables, but could
> not find anything useful.
> 
> Ideally, i would like to issue a command like:
> condition WPNUM !(location path/to/myfile.c:42)
> 
> If there is already a way to do this, i'd like to hear about it, or
> please consider it as feature suggestion.

You could use a condition like:

$pc != <some_address>

where <some_address> is the address of the instruction that changes the
location.

__Martin

  reply	other threads:[~2024-10-19 13:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-19  7:35 Etienne Buira via Gdb
2024-10-19 13:19 ` Martin Simmons [this message]
2024-10-24  8:57   ` Etienne Buira via Gdb

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=jea5f02ptf.fsf@localhost \
    --to=qqxnjvamvxwx@dyxyl.com \
    --cc=etienne.buira.lists@free.fr \
    --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