Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Feature suggestion: location conditioned watchpoint
@ 2024-10-19  7:35 Etienne Buira via Gdb
  2024-10-19 13:19 ` Martin Simmons
  0 siblings, 1 reply; 3+ messages in thread
From: Etienne Buira via Gdb @ 2024-10-19  7:35 UTC (permalink / raw)
  To: gdb

Hi all,

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.

Unfortunately, the bug did not show up when ran under gdb supervision,
even after enabling memory space randomisation, but that's another
topic.

Regards.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Feature suggestion: location conditioned watchpoint
  2024-10-19  7:35 Feature suggestion: location conditioned watchpoint Etienne Buira via Gdb
@ 2024-10-19 13:19 ` Martin Simmons
  2024-10-24  8:57   ` Etienne Buira via Gdb
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Simmons @ 2024-10-19 13:19 UTC (permalink / raw)
  To: Etienne Buira; +Cc: gdb

>>>>> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Feature suggestion: location conditioned watchpoint
  2024-10-19 13:19 ` Martin Simmons
@ 2024-10-24  8:57   ` Etienne Buira via Gdb
  0 siblings, 0 replies; 3+ messages in thread
From: Etienne Buira via Gdb @ 2024-10-24  8:57 UTC (permalink / raw)
  To: Martin Simmons; +Cc: Etienne Buira, gdb

On Sat, Oct 19, 2024 at 02:19:08PM +0100, Martin Simmons wrote:
> >>>>> 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

Hi Martin, thank you, sorry to have missed such an obvious way.

Regards.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-24  8:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-19  7:35 Feature suggestion: location conditioned watchpoint Etienne Buira via Gdb
2024-10-19 13:19 ` Martin Simmons
2024-10-24  8:57   ` Etienne Buira via Gdb

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox