Post Debugger: Difference between revisions

From Compost Wiki
Jump to navigation Jump to search
JeffM (talk | contribs)
No edit summary
JeffM (talk | contribs)
No edit summary
Line 39: Line 39:
"Next Post Line" is used to show the execution of the post one line at a time.
"Next Post Line" is used to show the execution of the post one line at a time.


Whilst the post is running, you can show each line of the post being executed
Whilst the post is running, each line of the post can be shown as it is being executed
but this can take some considerable time, so there is the "Display Post" option.
but can take considerable time.THe "Display Post" option controls this display, when it is unchecked the output will be suppressed for speed.
Unchecking this will suppress the updating of the Post section of the dialog.


The post can be run until a break point is reached, by pressing the "Run" button.
The post can be run until a break point is reached, by pressing the "Run" button.
Line 80: Line 79:
buttons and press the button next to the drop down menu to add it to the watch list.
buttons and press the button next to the drop down menu to add it to the watch list.


When you close the Post Debugger dialog, posting will continue as usual until it is completed.
If the Post Debugger dialog is closed, posting will continue as usual until it is completed.


==Notes==
==Notes==
Line 86: Line 85:
the .pst file that relates to the line numbers in the post. It will not include any of
the .pst file that relates to the line numbers in the post. It will not include any of
the source code itself. This means that the size of the compiled post will not be
the source code itself. This means that the size of the compiled post will not be
significantly increased, but it also means that you must have both .pst and .txt files
significantly increased, but it also means that both .pst and .txt files must be
in the same folder to use the debugger.
in the same folder for the debugger to work.


You should always remove the debug information (compile with "Generate Debug" unchecked)
Post developers can remove the post debugger information by recompiling the post with out option enabled in compost. The debug information will make the post slighty larger, but should not be a major concern. No source code included in a debug post so there is no thread of that information being exposed.
before send a .pst file to a customer. However, if you do forget to do this, the customer
will not see the debug information, even if they get hold of a copy of the PostDebug
plugin (unless you also send them a copy of the .txt file).

Revision as of 01:05, 7 March 2008

Overview

The post debugger is a tool that can be used by post developers to view the output and logic flow of a running post processor

Components

The post debugger requires 3 separate components to be run properly.

Post Debugger Plug-in

The plug-in provides the interactive interface to the post debugger and allows developers to view the posting process as it runs.

Installation

Copy the plug in PostDebug.dll into the Plugins folder

Compile

The post debugger requires the Compost3 compiler version 1.3.5 or later. This version contains an option in its Preferences dialog that allows for the generation of debug information (near the lower right corner of the dialog box ).

GibbsCAM

The post debugger also requires a running copy of GibbsCAM, and a part with valid operations.

Usage

When posting the user will see the Post Debugger dialog if the following conditions are met:

* The PostDebug.dll is in the Plugins folder
* The Post processor must have compiled with the "Generate Debug" option selected
* Both the prog and form (pst and txt) file must be in the same folder.

The debugger will look for a .txt file with the same name as the .pst file when it loads. It will use the txt file that has the same name as the currently runing post processor and load it for the prog. If this file is not current there can be problems.

Interface

The Debugger interface is divided into 3 sections. The top section is used to control the debugger, the middle section shows the source of the post (with line numbers) and the lower section shows the output code.

The top right of the control section provides buttons to control the posting. "Next Op", "Next Tool", "Next Flow" will post until the next op, tool or flow is reached. "Next NC" line will run until a new line of code is created. "Next Post Line" is used to show the execution of the post one line at a time.

Whilst the post is running, each line of the post can be shown as it is being executed but can take considerable time.THe "Display Post" option controls this display, when it is unchecked the output will be suppressed for speed.

The post can be run until a break point is reached, by pressing the "Run" button.

Breakpoints

There are a number of types of break point available. These allow the user to control when the debuggers stops the execution of the posted program.

Break At Op Num This option requires an operation number to be entered into the corresponding field. Execution will stop when the given op number is reached. The box next to the op number will be updated during posting to indicate the current op number.

Break At Tool Num" This is similar to "Break At Op Num" but will break on a given tool number.

Break At NC Cod This breakpoint is used to stop the execution when a block of code contains the given text. The check for text is not case sensitive.

When processing is stopped due to one of these break conditions, the box containing the Op number, Tool number or NC text will change to red to highlight the break.

The fourth method of breaking is to stop at a particular line in the post. When clicking on a line of text in the post display section, that line will change to yellow to show that it has been added as break point on that line. If the line is clicked again the breakpoint will be removed.

When posting stops due to a break, the "Back" button can be used to step backwards from the current line in the post, one line at a time to help to identify the path through the post to the current state. The "Fwd" button takes you in the opposite direction.

The "Watch" button provides a method to check the status of some variables and internal post registers. Click on the "Watch" button to show the "Watch Variables" dialog. The "Add Watch" button will show a list of Number variables, Flags and Internal Registers. You can simply watch the value, break when the value changes, or break when it changes to to a given value. This is the fifth type of break point available.

Select one of these from the drop down menus, select the Watch action from the 3 radio buttons and press the button next to the drop down menu to add it to the watch list.

If the Post Debugger dialog is closed, posting will continue as usual until it is completed.

Notes

When compiling with the "Generate Debug" option, Compost3 will add information to the .pst file that relates to the line numbers in the post. It will not include any of the source code itself. This means that the size of the compiled post will not be significantly increased, but it also means that both .pst and .txt files must be in the same folder for the debugger to work.

Post developers can remove the post debugger information by recompiling the post with out option enabled in compost. The debug information will make the post slighty larger, but should not be a major concern. No source code included in a debug post so there is no thread of that information being exposed.