Jmol/debugging: Difference between revisions
From Proteopedia
Jump to navigationJump to search
m User:Karsten Theis/Jmol/debugging moved to Jmol/debugging: So others can edit |
Eric Martz (talk | contribs) |
||
| Line 4: | Line 4: | ||
== General debugging techniques == | == General debugging techniques == | ||
There are multiple ways to insert breakpoints into Jmol scripts, pausing the script to verify the script | There are multiple ways to '''insert breakpoints''' into Jmol scripts, pausing the script to verify the script progress at a certain point, and allowing you to check the state of variables at this point. The "pause" command pauses the script and gives control to you until you type "resume" in the console. The "prompt" command, given without parameters, opens a pop-up screen with the stack trace of the script. | ||
There are a variety of commands described under "set (debugging)" in the [https://chemapps.stolaf.edu/jmol/docs/#setdebugging manual] that help with debugging and analyzing program crashes. For example, you can use the history function in the Jmol console to see which commands executed after setting the historyLevel to a non-zero value. | There are a variety of commands described under "'''set (debugging)'''" in the [https://chemapps.stolaf.edu/jmol/docs/#setdebugging manual] that help with debugging and analyzing program crashes. For example, you can use the history function in the Jmol console to see which commands executed after setting the historyLevel to a non-zero value. | ||
Of course, it is also possible to add strategic "print" statements to the script but the techniques described above are more flexible because they pause the script or give you a chance of a post-mortem analysis. | Of course, it is also possible to add '''strategic "print" statements''' to the script but the techniques described above are more flexible because they pause the script or give you a chance of a post-mortem analysis. | ||
== Techniques specific to the Jmol application == | == Techniques specific to the Jmol application == | ||