Error when getting thread stack trace

I created StackTrace utility that print stack trace of given thread without stopping it.

It has workaround that prevent Thread is inappropriate state error. Why it is needed? There are some bug in Haiku or I am doing something wrong? Also sometimes StackTrace cause to open crash dialog and if open Debugger is selected, thread is in debugged state (not exception) and can be continued. Why it happens?


That error appears to come from here:

1 Like

It seems that waiting for B_DEBUGGER_MESSAGE_THREAD_DEBUGGED debug message is needed. I added debug message loop and issue is no longer observed (