Re: Adding a condition on a hardware watchpoint based on watchpoint state

Roger Phillips via Gdb <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <PH0PR06MB8652504AC9E606A3B9B9BBFBAAE4A@PH0PR06MB8652.namprd06.prod.outlook.com>
Thanks will try!

________________________________
From: Philippe Waroquiers <[email protected]>
Sent: Friday, September 1, 2023 7:00 PM
To: Roger Phillips <[email protected]>; Tom de Vries <[email protected]>; [email protected] <[email protected]>
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 <[email protected]>
> Sent: Tuesday, August 29, 2023 10:24 AM
> To: Roger Phillips <[email protected]>; [email protected] <[email protected]>
> 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
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.