Geosoft GX Developer 8.5

GX Debugger

The GX Developer debugger is a flexible and usefull tool for debugging GXs, and will tremendously speed up your development.

By enabling the debugger on a GX, the user can step at run-time through the GXC code of the GX.  The user may place break points in the code, and search for strings.   Furthermore, this process gives the user access to the memory stack as well as the ability to modify the stack at run-time.  The illustration below displays a typical GX debugger session.  If you are familiar with Microsoft’s Visual Studio or a similar development environment, you will easily adapt to using this debugger.  

1 - The menu consists of a single item,Debug.

2 - The Debug options are (F9) to toggle breakpoints on/off, (F5) to continue to the next break point, or (F10) to single step through the code one line at a time.  These shortcut keys are the same as the Visual studio keys. 

3 – The Gutter displays the line numbers, breakpoints and the current line of execution. 

4 – The user can set/unset Breakpoints at the current cursor position by hitting F9.  A brown circle identifies the breakpoints in the gutter.  The debugger allows you to set breakpoint on any line in any of the files preloaded into the file list. Many lines do not actually contain any execution code and the debugger will skip over break points in these lines even if you set a breakpoint on them. Problems also arise on multi-line statements where the breakpoint will only be caught if set on the last line of the statement..

5 – A yellow arrow indicates the Current line of execution. If no such symbol exists in the file you are currently viewing, the current position of the GX execution is elsewhere in one of the other files in the File List.

6 – The Watch Window contains four tabs where you can add watches to variables in the debugged GX’s. Add a watch by typing the variable’s name in the Name column. If a variable is not in the current scope, it won’t be displayed. The size of strings and arrays are indicated in parentheses following the variable name. The second column (Value) contains the values of the watch variables. In the case of string, int and real variables you will be able to edit the values before stepping to the next line of execution or continuing the GX run.

7 – All the files found underneath the directory you specified in the DBGENABLE GX will be displayed in the File list. You can view the source code of any file in the list by double clicking on it.

8 – The Breakpoint list shows all the breakpoints active in the session. Double clicking on these will take you to the location in the source code.

9 – The Source Code displays the colorized source code of one of the files in you File List.  The colourized scheme follows the Visual Studio standards. 

Notes

There are dividers between the different parts of the debugger window that allow the resizing of the parts to individual preference. The whole window can also be resized. The positions will be remembered for the duration of the debugging session.

The watch windows are not the only way to inspect variable values. If you hover over a variable in the source code, a tool tip will pop up displaying its value.

When stepping (F10) to the next line of execution, and the GX is terminated, the debugger will retain the stepping mode.  This means as soon as on of the GX’s in the file list is run the debugger will pop up and display the current line of execution at the first executing line in that file. Another handy feature of stepping is that you may ‘step into’ GX’s in your file list by hitting F10 on a iRunGX_SYS call to such a GX.

Currently there is no checking for consistency between the GX binaries and the source code. If an outdated binary is used with newer source code, the breakpoints and source window may display wrong information and can cause confusing situations. For example, a blank line may be the current line of execution or none of your breakpoints will stop the execution of the GX. In this eventuality stop the process, reload the GX to debug, and run it again.

Dummy values will always be shown as an asterix character ‘*’. Similarly, you can change a numeric value of a variable to a dummy by typing an asterix in the Values column.

A specific element in the array may be indicated using square braces containing the 0-based index into the array. When you attempt to view an array by typing its name in the Name column it will show the first element (VariableName[0]) in it.  The alternative is to hover over the variable in the source code window; the tool tip will display the entire array. 

 

Geosoft GX Developer 8.5