Using GDB with Zeus

Find Tips and tricks on how to better use the Zeus IDE. Feel free to post your own tips but please do not post bug reports, feature requests or questions here.
Post Reply
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Using GDB with Zeus

Post by jussij »

The Zeus Workspace, Debugger menu launched the GDB debugger, and that debugger should work with any compiler that can produce DWARF debug information.
debugger.png
debugger.png (27.83 KiB) Viewed 3676 times
With the debugger running it can then be controlled using the resulting Debugger Control dialog:
gdb-controls.png
gdb-controls.png (15.52 KiB) Viewed 3673 times
NOTE: Other Zeus, D language specific features can be found here:
DCD Autocomplete
Using dfmt on Save
Using Dscanner Inside Zeus
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Re: Using GDB with Zeus

Post by jussij »

C Language Debugging Example
Consider the following test.c single file application:

Code: Select all

#include <stdlib.h>
#include <stdio.h>

int main(int argc, char *argv[])
{
  printf("Hello world!\n");

  for (int i = 0; i < argc; ++i)
  {
      printf("%d: => %s\n", i, argv[i]);
  }

  return 0;
}
Assuming the GCC compiler has been installed, the compiler details found in the C/C++ Document Type need to be changed to be changed to be:

Code: Select all

gcc -ggdb "$fn" -o "$fb".exe
With the test.c file active the Compiler, Compile menu will run this compiler command line:

Code: Select all

gcc -ggdb test.c -o test.exe 
That command line will produce a test.exe file containing DWARF symbolic information.

And with the test.c file active the Workspace, Debugger menu will run the GDB compiler for that test.exe file as shown below:
c-gdb.png
c-gdb.png (55.44 KiB) Viewed 3669 times
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Re: Using GDB with Zeus

Post by jussij »

D Language Debugging Example
Consider the following test.d single file application:

Code: Select all

import std.stdio;

void test(int index)
{
    writeln("Hello: ", index);
}

void main()
{
    writeln("Hello, World!");

    for (int i = 0; i < 10  ; ++i)
    {
        test(i);
    }
}
Assuming the LDC compiler has been installed, the compiler details found in the D Document Type need to be changed to be changed to be:

Code: Select all

ldc2.exe -gdwarf "$fn"
With the test.d file active the Compiler, Compile menu will run this compiler command line:

Code: Select all

ldc2.exe -gdwarf test.d
That command line will produce a test.exe file containing DWARF symbolic information.

And with the test.d file active the Workspace, Debugger menu will run the GDB compiler for that test.exe file as shown below:
d-gdb.png
d-gdb.png (55.63 KiB) Viewed 3667 times
Post Reply