DBX--The Debugger on Hercules

You are most likely wondering if you can use gdb on hercules. The answer is no.

However, Hercules has a debugger that goes with the CC compiler. It is called dbx.

When you compile, you will add the -g flag:

CC -g filename.cpp -o executable_file

You will start dbx by typing the following command:

dbx executable_file

DBX Command Summary

Command Action
help Display information about dbx commands.
run Start running the program under dbx.
print expression Display the contents of a variable or expression.
stop at line_number Set a breakpoint at the specified line_number.
clear line_number Clear the breakpoint set at the specified line_number.
status Display the number of each breakpoint.
delete number Delete the breakpoint specified by number.
delete all Delete all breakpoints.
step Execute just the next line of code.
next Execute just the next line of code but skip over any function calls in the line.
list Display lines of source code.
quit Exit dbx.

Notice that the major difference here between this debugger and gdb is in setting the breakpoints

For your reference

To learn more about dbx, you can use google to search for dbx tutorials. Here are a couple for your reference:

In the second tutorial, check out the command called trace