- tcp sockets
- COM port or .NET state
- open files
- java objects
- memory pointers to C or C++ objects
how to save the debugging state at matlab?
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi everyone,
I'm debugging a computational program on a server. This program rarely encounters errors, but when it does, the error occurs deep within a chain of function calls. I would like to save the complete state at the moment the error occurs, so that I can load this state on my local PC and debug it more conveniently.
Currently, after an error occurs on the server, I can save the variables at each level of the function call stack. However, this approach does not allow me to load and debug the state on my local PC, making the process very inconvenient.
Is there a way in MATLAB to save the full debugging state? Or are there any alternative methods to address this issue?
0 Kommentare
Antworten (1)
Walter Roberson
am 29 Mai 2025
Generally speaking, it is not possible to save the full debugging state.
Generally speaking, the current state of variables might include objects that cannot effectively be serialized. For example:
Generally speaking, in order to be able to approach what you are hoping for, you need to structure your code in a way that takes "snapshots" of important variables, together with a way that can reconstruct the state of the variables given a snapshot. Then have your code take snapshots periodically, and take a snapshot at the time the error occurs, and compare the state of the two most recent snapshots to try to debug the problem.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Whos finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!