Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Adding a condition on a hardware watchpoint based on watchpoint state
@ 2023-08-28 11:41 Roger Phillips via Gdb
  2023-08-29 10:24 ` Tom de Vries via Gdb
  0 siblings, 1 reply; 5+ messages in thread
From: Roger Phillips via Gdb @ 2023-08-28 11:41 UTC (permalink / raw)
  To: gdb

Greetings,

I want to install a condition on a hardware watchpoint so that only accesses are stopped that increase the value of the variable 1 -> 2 etc.

Is this possible?

Regards

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

* Re: Adding a condition on a hardware watchpoint based on watchpoint state
  2023-08-28 11:41 Adding a condition on a hardware watchpoint based on watchpoint state Roger Phillips via Gdb
@ 2023-08-29 10:24 ` Tom de Vries via Gdb
  2023-08-29 11:55   ` Roger Phillips via Gdb
  0 siblings, 1 reply; 5+ messages in thread
From: Tom de Vries via Gdb @ 2023-08-29 10:24 UTC (permalink / raw)
  To: Roger Phillips, gdb

On 8/28/23 13:41, Roger Phillips via Gdb wrote:
> Greetings,
> 
> I want to install a condition on a hardware watchpoint so that only accesses are stopped that increase the value of the variable 1 -> 2 etc.
> 
> Is this possible?
> 

There's an enhancement PR open about this (
https://sourceware.org/bugzilla/show_bug.cgi?id=29480 ).

Thanks,
- Tom


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

* Re: Adding a condition on a hardware watchpoint based on watchpoint state
  2023-08-29 10:24 ` Tom de Vries via Gdb
@ 2023-08-29 11:55   ` Roger Phillips via Gdb
  2023-09-01 19:00     ` Philippe Waroquiers via Gdb
  0 siblings, 1 reply; 5+ messages in thread
From: Roger Phillips via Gdb @ 2023-08-29 11:55 UTC (permalink / raw)
  To: Tom de Vries, gdb

Very well, thank you. Can you imagine if and when this goes into a release?

Regards

________________________________
From: Tom de Vries <tdevries@suse.de>
Sent: Tuesday, August 29, 2023 10:24 AM
To: Roger Phillips <heidegg@hotmail.com>; gdb@sourceware.org <gdb@sourceware.org>
Subject: Re: Adding a condition on a hardware watchpoint based on watchpoint state

On 8/28/23 13:41, Roger Phillips via Gdb wrote:
> Greetings,
>
> I want to install a condition on a hardware watchpoint so that only accesses are stopped that increase the value of the variable 1 -> 2 etc.
>
> Is this possible?
>

There's an enhancement PR open about this (
https://sourceware.org/bugzilla/show_bug.cgi?id=29480 ).

Thanks,
- Tom


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

* Re: Adding a condition on a hardware watchpoint based on watchpoint state
  2023-08-29 11:55   ` Roger Phillips via Gdb
@ 2023-09-01 19:00     ` Philippe Waroquiers via Gdb
  2023-09-01 19:57       ` Roger Phillips via Gdb
  0 siblings, 1 reply; 5+ messages in thread
From: Philippe Waroquiers via Gdb @ 2023-09-01 19:00 UTC (permalink / raw)
  To: Roger Phillips, Tom de Vries, gdb

In the meantime, you should be able to do what you want with command attached to the
watch point such as the below that watches the value of a variable i.

watch -location i
set var $prev = i
command $bpnum
if $prev < i
  printf "increase prev %d %d \n", $prev, i
  set var $prev = i
else
  printf "decrease prev %d %d \n", $prev, i
  set var $prev = i
  continue
end
end

On Tue, 2023-08-29 at 11:55 +0000, Roger Phillips via Gdb wrote:
> Very well, thank you. Can you imagine if and when this goes into a release?
> 
> Regards
> 
> ________________________________
> From: Tom de Vries <tdevries@suse.de>
> Sent: Tuesday, August 29, 2023 10:24 AM
> To: Roger Phillips <heidegg@hotmail.com>; gdb@sourceware.org <gdb@sourceware.org>
> Subject: Re: Adding a condition on a hardware watchpoint based on watchpoint state
> 
> On 8/28/23 13:41, Roger Phillips via Gdb wrote:
> > Greetings,
> > 
> > I want to install a condition on a hardware watchpoint so that only accesses are stopped that increase the value of the variable 1 -> 2 etc.
> > 
> > Is this possible?
> > 
> 
> There's an enhancement PR open about this (
> https://sourceware.org/bugzilla/show_bug.cgi?id=29480 ).
> 
> Thanks,
> - Tom
> 


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

* Re: Adding a condition on a hardware watchpoint based on watchpoint state
  2023-09-01 19:00     ` Philippe Waroquiers via Gdb
@ 2023-09-01 19:57       ` Roger Phillips via Gdb
  0 siblings, 0 replies; 5+ messages in thread
From: Roger Phillips via Gdb @ 2023-09-01 19:57 UTC (permalink / raw)
  To: Philippe Waroquiers, Tom de Vries, gdb

Thanks will try!

________________________________
From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
Sent: Friday, September 1, 2023 7:00 PM
To: Roger Phillips <heidegg@hotmail.com>; Tom de Vries <tdevries@suse.de>; gdb@sourceware.org <gdb@sourceware.org>
Subject: Re: Adding a condition on a hardware watchpoint based on watchpoint state

In the meantime, you should be able to do what you want with command attached to the
watch point such as the below that watches the value of a variable i.

watch -location i
set var $prev = i
command $bpnum
if $prev < i
  printf "increase prev %d %d \n", $prev, i
  set var $prev = i
else
  printf "decrease prev %d %d \n", $prev, i
  set var $prev = i
  continue
end
end

On Tue, 2023-08-29 at 11:55 +0000, Roger Phillips via Gdb wrote:
> Very well, thank you. Can you imagine if and when this goes into a release?
>
> Regards
>
> ________________________________
> From: Tom de Vries <tdevries@suse.de>
> Sent: Tuesday, August 29, 2023 10:24 AM
> To: Roger Phillips <heidegg@hotmail.com>; gdb@sourceware.org <gdb@sourceware.org>
> Subject: Re: Adding a condition on a hardware watchpoint based on watchpoint state
>
> On 8/28/23 13:41, Roger Phillips via Gdb wrote:
> > Greetings,
> >
> > I want to install a condition on a hardware watchpoint so that only accesses are stopped that increase the value of the variable 1 -> 2 etc.
> >
> > Is this possible?
> >
>
> There's an enhancement PR open about this (
> https://sourceware.org/bugzilla/show_bug.cgi?id=29480 ).
>
> Thanks,
> - Tom
>


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

end of thread, other threads:[~2023-09-01 19:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-28 11:41 Adding a condition on a hardware watchpoint based on watchpoint state Roger Phillips via Gdb
2023-08-29 10:24 ` Tom de Vries via Gdb
2023-08-29 11:55   ` Roger Phillips via Gdb
2023-09-01 19:00     ` Philippe Waroquiers via Gdb
2023-09-01 19:57       ` Roger Phillips via Gdb

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