Shop OBEX P1 Docs P2 Docs Learn Events
debug statement/usage questions, possible feature requests — Parallax Forums

debug statement/usage questions, possible feature requests

@cgracey (and P2 user community)

I've found the built-in 'debug' statements in PNut (and hopefully soon the PropTool) to be a very useful/powerful feature. Besides being useful for program debugging, the commands are essentially a text/graphical display engine suitable for generating actual program report/output.

A few questions I have are:

Is there a way for a running Spin2 or PASM2 program to detect that it is running in debug mode? (Query)
This would allow your program to alter its behavior, for example not start a PST terminal while in debug mode.

Is there a way for a running Spin2 or PASM2 program to temporarily turn-off debugging mode? (Control)

If not I would like to request that mechanisms/commands be made a available to do the above tasks.


Also when you compile-to-Flash-with-debug, your program is stored with the debug commands embedded. So even when you re-start your program by power cycling the P2, your debug output will continue to be displayed. That's great.
Now what about the situation where you have closed the existing debug windows and then restart your stored-program-with-embedded-debug later, is there a way to get the debug window(s) back open to receive the data flow? So far it appears that you have to go back through the compile with debug process to get the debug windows back on.

I've looked around in the various P2 documents and haven't found specific answers to my above questions/observations.

Comments

  • Is there a way for a running Spin2 or PASM2 program to detect that it is running in debug mode? (Query)
    This would allow your program to alter its behavior, for example not start a PST terminal while in debug mode.
    Currently a method to check this is missing.
    Is there a way for a running Spin2 or PASM2 program to temporarily turn-off debugging mode? (Control)
    If not I would like to request that mechanisms/commands be made a available to do the above tasks.
    Currently this is not possible. But this topic was discussed in the P2 Live forum this week.
    Now what about the situation where you have closed the existing debug windows and then restart your stored-program-with-embedded-debug later, is there a way to get the debug window(s) back open to receive the data flow? So far it appears that you have to go back through the compile with debug process to get the debug windows back on.
    I didn't have it tried but one should be able to use PST (using the right baud rate) for the debug output as it is only text.
Sign In or Register to comment.