I am compiling Free Pascal code. I don't see anyway to execute it (without the debugger)?
In trying to use the debugger (which I have set to be gdb and put in the directory and path) I am getting this error:
---------------------------------------------------------------------------------------------------
No debugger module has been defined for the currently active project.
NOTE: Use the Debugger, Options menu to define a debugger module and
the Configure button, then Help button for more details.
----------------------------------------------------------------------------------------------------
If I go to Debugger, Options, I don't see the words "debugger module". (I have filled in "Executable" and "Directory" under the Debugging tab) There is no help for that dialog box and I don't get a result from "Quick Search" on "debugger module". Not sure what I am supposed to do.
Debugger Module and running a program
Debugger Module and running a program
Last edited by Dataflex on Sat Sep 23, 2023 7:57 am, edited 1 time in total.
Re: Debugger Module and running a program
In the Workspace setting there is a Debugger page. While that page integrates to the gdb.exe debugger, I does not need to be used and I would recommend not using this feature, only because gdb does not work well on Windows, and only works for certain compilers.
Setting up Workspace
Consider a very simple example on how to setup a Zeus workspace.
I have a single MyProgram.c file as shown below:
I use the Workspace, Open Folder menu option to create a workspace for that file, by opening the folder location of the file.
NOTE: Obviously the other Workspace create methods can also be used. In this case the Workspace, Open Folder option was used as it is by far the easiest method to create a workspace.
Here is the workspace created using this menu. Notice that the name of the folder, which in this case was the folder C, is used to name of the project and the workspace. Setting up the Compiler
Now if I edit the workspace Compiler settings I can add a command to compile a single file in that workspace.
In this case I use the following C compiler command line to compile a C file as shown below:
NOTE: Naturally this command line will need to be modified to compile a single file for the compiler that you are using.
The completed setup for the compiler is shown below: Notice how the file is represented by the "$fn" tag.
You can use any Zeus tag in that command line and if you run the ztag.lua macro using the Macros, Execute Script menu, it will show Zeus tags and their equivalent values.
To see the details of that macro place the cursor on the file name below and use the View, Open File menu to open the file:
Also notices that the compiler has been configured to only show output on warnings and errors. This can be changes to suit.
Setting up the Project
In the Project panel you add the commands to build the whole project. There are also options to clean and rebuild the project.
Generally you would use some sort of build tool for this command line.
In my case as this is a single file project, I can get away with this very simple C command line that will create an executable from a single file as shown below:
NOTE: Naturally this command line will need to be modified to produce an executable for the build tools that you are using.
Here is the complete Project setup. Setting up the Debugging
In the Debugger panel you add a command line to run the resulting exactable.
Now in my case the Project build creates the following executable:
So all I need to do is add that executable to the Debugger panel as shown below.
Notice that I also added some command line parameters and I capture the output produced.
I also use the $wdd macro tag to set the directory to match the workspace drive and directory.
Also notice that these are Debug settings as specified by the blue rectangle found in the top left corner.
There are a second set of configuration options for Release mode, allowing for special release builds if required.
Running these Commands
With all of the settings in place I can now access these command lines as follows.
All of these menus can also be bound to a keyboard key to make them easier to use.
The easiest way to do this is as follows:
Cheers Jussi
Setting up Workspace
Consider a very simple example on how to setup a Zeus workspace.
I have a single MyProgram.c file as shown below:
Code: Select all
#include <stdio.h>
int main(int argc, char *argv[]) {
puts("Hello, World");
for (int i = 0; i < argc; ++i) {
puts(argv[i]);
}
return 0;
}
NOTE: Obviously the other Workspace create methods can also be used. In this case the Workspace, Open Folder option was used as it is by far the easiest method to create a workspace.
Here is the workspace created using this menu. Notice that the name of the folder, which in this case was the folder C, is used to name of the project and the workspace. Setting up the Compiler
Now if I edit the workspace Compiler settings I can add a command to compile a single file in that workspace.
In this case I use the following C compiler command line to compile a C file as shown below:
Code: Select all
cl.exe -c "$fn"
The completed setup for the compiler is shown below: Notice how the file is represented by the "$fn" tag.
You can use any Zeus tag in that command line and if you run the ztag.lua macro using the Macros, Execute Script menu, it will show Zeus tags and their equivalent values.
To see the details of that macro place the cursor on the file name below and use the View, Open File menu to open the file:
Code: Select all
ztag.lua
Setting up the Project
In the Project panel you add the commands to build the whole project. There are also options to clean and rebuild the project.
Generally you would use some sort of build tool for this command line.
In my case as this is a single file project, I can get away with this very simple C command line that will create an executable from a single file as shown below:
Code: Select all
cl.exe "$fn"
Here is the complete Project setup. Setting up the Debugging
In the Debugger panel you add a command line to run the resulting exactable.
Now in my case the Project build creates the following executable:
Code: Select all
MyProject.exe
I also use the $wdd macro tag to set the directory to match the workspace drive and directory.
Also notice that these are Debug settings as specified by the blue rectangle found in the top left corner.
There are a second set of configuration options for Release mode, allowing for special release builds if required.
Running these Commands
With all of the settings in place I can now access these command lines as follows.
- The Compiler, Compile menu can be used to run the Workspace Compile command line for the currently active file.
- The Workspace, Build menu has options for Make, Clean and Rebuild that run the correspond Workspace Project command lines.
- The Workspace, Build menu has the Start Debug Executable and Start Release Executable which run the corresponding Workspace Debugger command lines.
All of these menus can also be bound to a keyboard key to make them easier to use.
The easiest way to do this is as follows:
- Record a macro
- Select the menu in question
- Finish recording the menu
- Viewing the macro source code produced
Cheers Jussi