Debugger ignores hard breaks

While we’ve all been affected by soft breakpoints being ignored (and often breaks occurring randomly here and there), this is the first time i’ve had the debugger blow past a hard break.

This is on the heels of my recent report of thread sleep woes discussed recently: Thread.SleepCurrent() broken in 2025R2.1 with Preemptive thread - #23 by Peter_Stys

Here is my code snippet inside a pre-emptive thread (compiles a summary after large image load job, details not important), key is the break stmnt at the end:

#if DebugBuild
  dim DEBUG_n_loaded, DEBUG_n_NOTloaded as integer = 0
  dim DEBUG_me_n_loaded as integer = me.n_loaded.Value
  dim DEBUG_itkLoaderMP_n_objects as integer = app.itkLoaderMP.DEBUG_n_objects
  dim DEBUG_me_n_total as integer = me.n_total
  
  for tCtr as integer = 0 to nTiles-1
    dim t as imageDataModule.imageTileClass = me.tileList(tCtr)
    if t.loadedMP then
      DEBUG_n_loaded = DEBUG_n_loaded+1
    else
      DEBUG_n_NOTloaded = DEBUG_n_NOTloaded+1
    end if
  next
  me.DEBUG_saveDebugInfo "Expecting a hard break in loaderWorker"
  break
  me.DEBUG_saveDebugInfo "   Returned from hard break in loaderWorker"
#endif

I have a plain class that instantiates and starts N pre-emptive workers where this snippet executes. With a 2 worker test, my companion logging app clearly shows that program flow reaches the break line in both workers:

but I get only a single break in the debugger; the debugger blows past this line in all but the 1st worker (worker1 eventually proceeds past the hard break further down, but the debugger never pauses).

I will not be filing a feedback case because i was advised that unless I prepare a stripped down test app, not to bother. After spending a lot of time doing this (along with Mike D) for https://tracker.xojo.com/xojoinc/xojo/-/issues/80611 I simply don’t have time to start over again.

Just a heads up to the community that there are issues with pre-emptive threads it seems, and to advise Xojo so they can investigate as they see fit. Makes debugging PE threads very difficult.

1 Like

Fortunately, this was also easy to reproduce in a tiny project, so I created a new ticket: https://tracker.xojo.com/xojoinc/xojo/-/issues/80631

1 Like

You rock Mike. I can confirm that I also see the break failure (xojo 2025r2.1, macOS sonoma 14.7.2)

and worse, i just noticed that if you manage to pause at a soft breakpoint ahead of the hard break, stepping over the latter crashes ur app.

1 Like

Good work! @Peter_Stys : https://tracker.xojo.com/xojoinc/xojo/-/issues/80631 is already marked as Closed & Fixed. :slight_smile:

If you think the crashing bug is different, you may want to create a new case though?

1 Like

And the milestone is 2025r3.1 :+1:

1 Like

i strongly suspect it’s related

now if the textfield rendering is also fixed in 25r3.1, i’m in.