Post Debugger: Difference between revisions
No edit summary |
No edit summary |
||
| Line 46: | Line 46: | ||
==Connecting GibbsCAM and Compost== | ==Connecting GibbsCAM and Compost== | ||
Once, the session is started, GibbsCAM and Compost will connect to each other and establish a debug link. When the link is established, Compost will enable a number of debug features. | Once, the session is started, GibbsCAM and Compost will connect to each other and establish a debug link. When the link is established, Compost will enable a number of debug features that are available from the debug menu. | ||
Some features, such as step control and the output window, will only be functional when GibbsCAM is actually posting. | |||
==Breakpoints== | |||
A breakpoint is a way to tell GibbsCAM to pause posting at a specific location in the program, or when a specific set of conditions are true. Breakpoints are primarily accessed via the Breakpoints window. | |||
From this window a post developer can define two types of breakpoints. | |||
===Line Breakpoints=== | |||
Line breakpoints will pause the post execution right before the first command of the selected line is executed. | |||
===State Breakpoints=== | |||
State breakpoints do not define a specific lotion in the post to break on, but a set of conditions. When all the conditions are true, the program will break and allow the developer to inspect the state. The most common condition to use is "Specified text is in output" so developers can easaly learn what part of the post is generating questionable output. | |||
==Step Controll== | |||
When the post program is in the break state, GibbsCAM will not process any more commands until instructed to do so by the debugger. Several tools are available to the developer to control how the program will continue from this state. | |||
* Resume. Causes the program to continue as normal and process commands until ether the program ends, or another breakpoint is encountered. | |||
* Step Over. Executes the next command and stops on the next one in the current progsub. If that command is a call to a progsub, then the entire progsub will be executed before control is returned to the next command. | |||
* Step Into. Executes the next command in any progsub. If the next command is a progsub, the program will break at the first command in that progsub. | |||
* Step Out. Runs to the end of the current prog sub and then breaks at the next command in the calling progsub. | |||
* Run to next line. Runs to the first command of the next line in the prog. | |||
* Run to Cursor. Runs to the command where the cursor is in the compost editor window. | |||
[[Category:Articles]] | [[Category:Articles]] | ||
Revision as of 17:36, 1 June 2016
Overview
Debugging a post processor requires several components.
- A debug enabled post
- A debug tool
- A GibbsCAM session with a part that can run the post
With these components, the debug tool allows the post developer to inspect how the GibbsCAM part uses the post processor as it runs.
Legacy Post Debugger
The legacy post debugger was an experimental tool that was used with some versions of Compost3 to assist developers in debugging post processors. It was de-supported with GibbsCAM V11 and Compost4.
Compost4 Integrated Debugger
Compost4 v 4.3 and later includes an integrated debugger.
File Format
Compost was designed from inception to contain integrated debug services and the POST format has always included debug information. The debugger built into Compost4 works using these features of the POST format, so it can only debug posting sessions that use a POST file. Compost4 always upgrades a PST file into a POST when opened. When using the debugger post developers must use the POST version of the file inside GibbsCAM when debugging.
Features
Debugger Features include
- Breakpoints
- interactive code stepping
- Output inspection (Output Window)
- Variable/Flag inspection (Variables)
- Program State inspection (Watches and Callstack)
Usage
The Compost4 debugger has 4 software components.
- Compost4 v.4.3 or later
- GibbsCAM 11.8.2 or later (soon to be 11.3.x or later)
- GibbsCAMCompostDebugAddin (the plug-in that links GibbsCAM and Compost).
The GibbsCAMCompostDebugAddin is shipped with all compatible versions of GibbsCAM, but is disabled by default. Before a post can be debugged, this plug-in must be manually enabled in the plug-in manager.
When enabled, the post developer has 2 choices for how to start a debug session.
Starting from GibbsCAM
When a part is open in GibbsCAM and a post is selected, the Compost Debugger -> Attach to Compost menu item can be used to start a debug session using the current part/post. If there are no compost instances running, GibbsCAM will start a new one and open the selected post. If a single compost instance is already running, it will automatically be used. If there are multiple compost instances running the plugin will show a compost selection dialog to allow the user to pick what compost instance to use.
Starting from Compost
A post developer can trigger a debug session from the debug menu or the debug toolbar button. When started from Compost, a new instance of GibbsCAM is always started.
Connecting GibbsCAM and Compost
Once, the session is started, GibbsCAM and Compost will connect to each other and establish a debug link. When the link is established, Compost will enable a number of debug features that are available from the debug menu.
Some features, such as step control and the output window, will only be functional when GibbsCAM is actually posting.
Breakpoints
A breakpoint is a way to tell GibbsCAM to pause posting at a specific location in the program, or when a specific set of conditions are true. Breakpoints are primarily accessed via the Breakpoints window.
From this window a post developer can define two types of breakpoints.
Line Breakpoints
Line breakpoints will pause the post execution right before the first command of the selected line is executed.
State Breakpoints
State breakpoints do not define a specific lotion in the post to break on, but a set of conditions. When all the conditions are true, the program will break and allow the developer to inspect the state. The most common condition to use is "Specified text is in output" so developers can easaly learn what part of the post is generating questionable output.
Step Controll
When the post program is in the break state, GibbsCAM will not process any more commands until instructed to do so by the debugger. Several tools are available to the developer to control how the program will continue from this state.
- Resume. Causes the program to continue as normal and process commands until ether the program ends, or another breakpoint is encountered.
- Step Over. Executes the next command and stops on the next one in the current progsub. If that command is a call to a progsub, then the entire progsub will be executed before control is returned to the next command.
- Step Into. Executes the next command in any progsub. If the next command is a progsub, the program will break at the first command in that progsub.
- Step Out. Runs to the end of the current prog sub and then breaks at the next command in the calling progsub.
- Run to next line. Runs to the first command of the next line in the prog.
- Run to Cursor. Runs to the command where the cursor is in the compost editor window.