GstarCAD 2027 LISP Debugger Guide

Contents

e0ca5123951146eb6ce4e8bc

Visual Studio Code

Install Visual Studio Code (VS Code)

Visual Studio Code (VS Code) is a free cross-platform source code editor developed by Microsoft®. The software supports functions such as syntax highlighting, intelligent code completion, code refactoring, and viewing definitions, and has built-in command-line tools and Git version control system.

With the functions provided by VS Code, it is possible to debug the program code in GstarCAD. Enter 'VLIDE' or 'VLISP' at the command line of GstarCAD to call up VS Code. If VS Code is not installed, the following message appears:

a5d6fe71b6b81e825a32abb8

Click the link https://code.visualstudio.com/ in the above window or visit the official website of VS Code directly to download and install VS Code.

f6b240dbf0672105d32dccd0

As an example, the following shows the process of installing VS Code for Windows after download.

83f1348686fb26e8203b05bc e75d1f479ff9e5a5948accae ef0b4d3787a34b91ad3fb616 abde573049336a086f927bac 716afa33fd6d0848fa6b39bc 6a515059125bc247f80e139f

Install GstarLisp Plug-in

When starting VS Code through GstarCAD, GstarLisp plug-in is automatically installed by default. If there is a new version of GstarLisp, it will be automatically updated next time when starting VS Code through GstarCAD.

GstarLisp plug-in can also be installed manually. In this case search 'GstarCAD', 'CAD' or "LISP" in the VS Code application store, select 'GstarLisp' and click to install.

After the plug-in is installed successfully, the icon of the GstarLisp is displayed in the activity bar. Details of GstarLisp, including name, introduction, features, new functions, installation, user guide, license information, change log, etc. can also be viewed as shown below.

f032e79eab96498a898cb081

Visual Studio Code (VS Code) User Interface

After VS Code and GstarLisp plug-in are installed, input 'VLIDE' or 'VLISP' at the GstarCAD command line to start VS Code.

7e5e6944db5e1f2e48971e9a

The following screenshot shows the user interface of VS Code. To learn more details about the user interface please visit the official website of VS Code at:

https://code.visualstudio.com/docs/getstarted/userinterface

4c0cd2af19f167c524741e39
  • Activity Bar (A): Located on the far left side. Allows switching between views, debugging and installing plug-ins, etc.

  • Side Bar (B): Containing different views (like the Explorer) to assist working on projects.

  • Editor (C): Working area for editing files. Possible to open multiple editors vertically and horizontally alongside.

  • Minimap (D): Code outline that appears on the right side of the editor. Possible to click or drag the shaded area to quickly jump to different sections of the file being edited.

  • Panels (E): Different panels displayed below the editor area for output or debug information, errors and warnings, or an integrated terminal.

  • Status Bar (F): Information about the opened project and the files being edited.

File

Open File

Click the icon of GstarLisp to enter the view. Click Open Folder icon, select the directory to load and the .lsp and .dcl files are filtered out and listed.

  • Click the file(s) in the list to be opened in the editor area on the right.

  • Click the Refresh to reload the selected directory file(s) if needed.

9c08ec9004c9f34ab90054fd

Edit File

The opened file(s) can be edited with rich editing functions provided by GstarLisp, such as:

  • Syntax highlighting

  • Smart hints

  • Automatic code completion/Code fragment

  • Parenthesis matching

  • Code folding

4078e07dac819d302faba553

Debugging

Debug Mode

Add Configuration

GstarLisp provides two debug modes: Attach mode and Launch mode

  • Attach Mode: Attach a debug process to a running CAD process.

  • Launch Mode: Start a new CAD process by specifying the absolute path of the CAD running file.

The debug mode can be customized by editing the 'launch.json' file, following steps below:

  1. Click create a 'launch.json' file.
8cad21d0cde5f29f0d496273
  1. Select a debug mode, GstarLisp-Attach or GstarLisp-Launch, and add it to 'launch.json' file.
f8fdd9b7006d3da05a29a1d4
  1. Click Add Configuration to add another debug mode to 'launch.json' file.
62644e09a17d7c4df450ddff
  1. Save the modifications to 'launch.json' file.
67dab375dd163a21beed1d22
  1. With the above configuration, it's possible to switch between the two modes during debugging.
9b60b8e24c094bac87d10328

Attach Mode

If Attach mode (GstarLisp-Attach) is selected, attachable CAD process need to be selected from the list in the debug window, as shown below, and then click Run to start debugging.

6f90b6ac16ad5593d3a96a68

This debug mode is not able to be used if no attachable CAD process is selected. VS Code pops up the following message and prompts to change the configuration of 'launch.json' file or open the CAD.

fe3ce17863b0aadf8433848e

Launch Mode

If Launch mode (GstarLisp-Launch) is selected, the absolute path of CAD running file (path format: e.g. 'C:\Program files\Gstarsoft\GstarCAD2026\gcad.exe') needs to be specified in the extension settings of GstarLisp, as shown below. After the setting is completed, click Run to start a new CAD process for debugging.

e5f463faf5e3b74abe53d130

If the absolute path of CAD running file is not specified, a message is displayed in the debug window to prompt specifying the path.

bec2d697d6184b248300f294 c640730fee3a2823c194586c

If there is already a running CAD process on the specified path, the following message is displayed when debugging (early versions of VS Code (before 1.57.1) do not have this function). Select Yes to start another GstarCAD instance, or select Cancel to close the window.

9ea4db414ab9ca49899dd935

Variable

Locals: Display variable values of the executed code by hovering over their source in the editor.

Last Value: Display the latest value variable.

NOTE

  • When the breakpoint is hit for the first time, the value of Last Value is not displayed.
  • In GstarLisp, Last Value displays the latest value of variable while AutoLisp displays the latest value/result of variable/expression.
1d1da598ee29c86a3d864b09

Watch

Watch the real-time value change of specified variables and expressions.

85b135e0a706ab21d8fa23a2

Add the variables or expressions to the watching list by clicking button. When debugging, the values of variables and expressions in the watching list are real-time updated and displayed.

1f568952c3fb61f9a85c7416

To remove variables or expressions from watching list please click button.

b506900e46fdf33fec9cedcf

It is also possible to add, edit and remove an expression from context menu by right-clicking WATCH.

ec4c3f1dd786ddc40759feb8

Call Stack

In GstarLisp, CALL STACK mainly displays the names of the called functions. It is possible to jump to the line where a function is located by double-clicking the function name.

4363df192cd120a76c125f19

Breakpoint

When the program runs to the line where a breakpoint is located, it will be interrupted (NOTE: When the program is interrupted, the line where the breakpoint is located is not run yet).

81843f84f4713cc018ec0b0c
  1. Set breakpoint: select the line of code where a breakpoint is set
  • In the left area, click line number to set a breakpoint, click again to cancel the breakpoint.

  • In the left area, right-click and select Add Breakpoint from the pop menu.

  • Press F9 to set a breakpoint, press F9 again to cancel the breakpoint.

  1. Delete/disable breakpoint:
  • Right-click the active breakpoint and select Delete Breakpoint or Disable Breakpoint from the pop menu.

  • Click to delete or disable the breakpoints at the side bar.

  • Delete all breakpoints at the side bar.

657fc57fdd3f63da49fe4797

Debug Console

Variables or expressions to be evaluated can be entered below the console.

  • When inputting a variable or an expression that exists in the code, the value of the variable or expression is displayed.

  • If the input variable or expression does not exist, the name of input variable or expression is displayed.

In addition, debug console also displays log information to help locate problems.

44ad85c262ff26919cc4a8b5

Debug Toolbar

8817491f62966fd84afede7d

Play/Continue

Play/Continue/(F5): Jump to the next breakpoint.

Step Over

Step Over (F10): Execute the current line of code and jump to the next line. It does not stop even the current line contains a function call (execute the whole sub-function as a step).

In GstarLisp, press F10 to execute the line and jump to the next line, while in AutoLisp, press F10 to execute the line, and then press F10 again to jump to the next line.

fa2e0dbb1eca983d8abe885b

Step In

Step In (F11): Step through the line of code. If the current line contains a function call, execute the first line of the called function (enter the sub-function and continue stepping in).

a473d959368625925502815a

Step Out

Step Out (Shift+F11): When stepping in a sub-function and stepping out, execute the unexecuted section of the function.

Restart

Restart (Ctrl+Shift+F5)

Under Attach Mode: Restart current debugging without ending the current CAD process.

Under Launch Mode: Terminate the current debugging, end the current CAD process (without asking whether to save the drawing) and restart a new CAD process for debugging.

Stop/Disconnect

Stop/Disconnect (Shift+F5):

Under Attach Mode: Stop the current debugging without ending the current CAD process.

Under Launch Mode: Stop the current debugging, and end the current CAD process (without asking whether to save the drawing).

Copyright reserved: Gstarsoft Co.,Ltd

Copying and referencing any part of this document is allowed. No part of this document may be changed without permission. Please keep this statement when copying or referencing this document.

a0738154638bd440fb2190e1