Page 1 of 1

Setting a breakpoint if variable changes?

Posted: Sun Oct 09, 2022 2:45 pm
by miskox
Is it possible to set a breakpoint on a specific variable when it changes the value?

Thanks.
Saso

Re: Setting a breakpoint if variable changes?

Posted: Sun Oct 09, 2022 3:37 pm
by mk-soft
Yes,

For example:
- Start debugger with 'CallDeugger'
- Goto menu Debugger and add 'Data Breakpoints'
--- Condition: var <> 0
- Continue

Code: Select all

Global i, var

CallDebugger

For i = 1 To 100
  If i = 10
    var = 1
  EndIf
Next


Re: Setting a breakpoint if variable changes?

Posted: Sun Oct 09, 2022 6:08 pm
by STARGÅTE
:shock:
I've been using PureBasic since 2004, but I saw this feature for the first time today.
Good to know, thanks.

Re: Setting a breakpoint if variable changes?

Posted: Sun Oct 09, 2022 10:22 pm
by BarryG
Another fantastic debugging feature is the Watchlist. This is a window that shows real-time updates of any variables that you nominate, so you can see them as they change without needing to use the Debug() command everywhere.

Re: Setting a breakpoint if variable changes?

Posted: Mon Oct 10, 2022 6:35 am
by miskox
Thanks. I will try the 'call debug'.

Saso

Re: Setting a breakpoint if variable changes?

Posted: Mon Oct 10, 2022 7:21 am
by mk-soft
STARGÅTE wrote: Sun Oct 09, 2022 6:08 pm :shock:
I've been using PureBasic since 2004, but I saw this feature for the first time today.
Good to know, thanks.
I've been using Purbasic since 2005. I've seen it for a while, but I tried it for the first time. :wink:

Re: Setting a breakpoint if variable changes?

Posted: Mon Oct 10, 2022 12:13 pm
by miskox
BarryG wrote: Sun Oct 09, 2022 10:22 pm Another fantastic debugging feature is the Watchlist. This is a window that shows real-time updates of any variables that you nominate, so you can see them as they change without needing to use the Debug() command everywhere.
I use Watchlist all the time. But in my case I would have to press F8/F11... to many times because I am not sure when change happens.

Thanks.
Saso