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:
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?
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
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=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
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
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?