Debugger ignores manually changed values

I use the following constructs often to manually redirect code flow during debugging:

#if DebugBuild dim debug_b as Boolean = false if debug_b then ' bkpoint here dim debug_m_uncompressedArr(), debug_m_scaledArr(), debug_m_descaledArr() as UInt16 for j as integer = 0 to 1000 debug_m_uncompressedArr.append(m_uncompressed.UInt16Value(j*2)) debug_m_scaledArr.append(m_scaled.UInt16Value(j*2)) debug_m_descaledArr.Append(m_scaled.UInt16Value(j*2) / scaleUpFactor) next break end #endif

I break at the if stmnt and if I want to execute the debug block I manually change debug_b to TRUE. As you can see:

(or if you can’t here is the screenshot link:
https://www.dropbox.com/s/7wggk2olrb3o1vx/Debugger%20ignores%20manually%20changed%20values.png?dl=0)

debug_b is now True and I guarantee you the next step skips over the if-then block. This worked great in RS to control flow and terminate long loops early. What’s wrong with Xojo?

Peter.

try this
change

dim debug_b as Boolean = false

to

const debug_b as Boolean = false

or instead

#if DebugBuild and TRUE

If I do it that way, I cannot change the value of debug_b (and therefor program flow) dynamically on the fly while debugging. I found that if you declare debug_b as a static at the top of the method it works. Doesn’t help with j in a long loop that you want to terminate early tho.

What version of Xojo are you using? I just tried it in 2019r2.1 and it worked as expected, program flow could be altered during debug without issue:

#If DebugBuild Dim b As Boolean = False If b Then '<-- breakpoint here, b changed to True in IDE at runtime during break Dim c As Integer system.DebugLog("test1") For i As Integer = 0 To 1000 system.DebugLog("test2") Next End If #EndIf

Every day is a school day. No idea that was possible

debugging in 32 or 64 bit ?
I’ve had issues with the debugger in 64 bit

Nope, changing the value doesn’t work:

Xojo 2019r2.1 on Catalina. Things that shall not be named have an even more interesting behaviour: a nice had crash.

For clarity my test was on windows with a 32bit app.

Nothing to add as I’ve learned long ago in Xojo to not bother with editable values in the debugger. I’ve seen them either ignored or cause hard crashes in the running project AND the IDE itself.

[quote=465938:@Peter Stys](or if you can’t here is the screenshot link:
https://www.dropbox.com/s/7wggk2olrb3o1vx/Debugger%20ignores%20manually%20changed%20values.png?dl=0 )[/quote]
If you change that ?dl=0 to ?raw=1 in your DropBox image link, the image will display inline in the forum.

[quote=465972:@Norman Palardy]debugging in 32 or 64 bit ?
I’ve had issues with the debugger in 64 bit[/quote]
This is with 2019v2.1 in 64bit mode, so obviously there is an issue here

now that is a great tip Tim!

issues like this (never mind edited value ones as well)
<https://xojo.com/issue/57782>

for now since I’m not running catalina I can debug in 32 bit mode which is VERY reliable
64 bit - not so much esp after more than a few runs of the app

In the window’s close event:

    dim b as Boolean = true
    break  ' set b to false to omit cleanup
    if b then 
      self.cleanup
    end

It doesn’t get any simpler. 64bit, macOS.
Latest xojo where we got a fancy worker class that I really like, but bugs like this persist? it’s been a year?