Short Pause doesn't come back

18 次查看(过去 30 天)
Gavin
Gavin 2024-10-14
回答: Dirk Engel 2025-1-27,23:46
Using App Designer I was running my program with no breakpoints set.
Suddenly it stopped running in a place it shouldn't so I broke out to see what's going on and found this:
My understanding is that the open arrow signifies a place where the code has called a routine and not come back yet.
So what's wrong with this pause this time, after it ran fine 9 times in the last 10 seconds or so?
  6 个评论
Gavin
Gavin 2024-10-24
After completely crashing a few times I restarted ML and now it's working fine. I didn't change my code but I noticed after recovery that some of my callbacks had been disconnected from their components. For whatever reason it's all working now.
Gavin
Gavin 2025-1-27,19:50
I'm still wondering what the hollow arrow means. Something higher on the stack of processes needing attention?

请先登录,再进行评论。

回答(1 个)

Dirk Engel
Dirk Engel 2025-1-27,23:46
The white/hollow arrow indicates that the line is currently executing, but that the workspace is currently unloaded. Consider the following case where the debugger stopped at the break point. The workspace of function print() is currently loaded, but the workspaces of functions button_Callback() and createButton(), which are up the call stack, are currently unloaded.
So, you have access to the local variable "text", but not to the variables "obj", "s", "e". If you step up the callstack, e.g. using dbup, the workspace of button_Callback() gets loaded and the worspace of function print() gets unloaded.
Now you have access to the local variables "obj", "s" and "e", but not to "text".
Note that, as a side effect, the pause() function executes pending callbacks. There probably was a callback function executing down the call stack which was stuck for whatever reason. Assumingly, that function was a builtin function, in which case the debugger jumps to the first non-builtin function up the call stack instead. And since the workspace of another function down the call stack was loaded, you got the white arrow. Next time, take a look a the workspace editor. It may provide some clues.

类别

Help CenterFile Exchange 中查找有关 Environment and Settings 的更多信息

标签

产品


版本

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by