LinuxCommandLibrary

dbx

Debug programs

TLDR

Create a new dbx project in the current working directory

$ dbx configure --profile [DEFAULT]
copy

Sync local files from the specified path to DBFS and watch for changes
$ dbx sync dbfs --source [path/to/directory] --dest [path/to/remote_directory]
copy

Deploy the specified workflow to artifact storage
$ dbx deploy [workflow_name]
copy

Launch the specified workflow after deploying it
$ dbx launch [workflow_name]
copy

SYNOPSIS

dbx [ options ] [ program [ corefile ] ]

PARAMETERS

-a process_id
    Attach to a running process specified by its process ID.

-c commandfile
    Execute commands from the specified file upon startup.

-d directory
    Add the directory to the source search path.

-I directory
    Specify an include directory.

-k
    Kill the program after exiting dbx.

-r
    Run the program immediately upon startup.

-s string
    Set an environment variable.

-v
    Enable verbose mode.

program
    The executable program to be debugged.

corefile
    The core dump file to be analyzed.

DESCRIPTION

dbx is a source-level command-line debugger
primarily used for debugging programs written in C, C++, and Fortran. It allows users to inspect the state of a running program, set breakpoints, step through code, examine variables, and modify program execution. dbx provides a powerful interface for finding and resolving software bugs.
Although it has been superseded by gdb in popularity, it remains available on some systems and is still useful for legacy code or when working in specific environments where it is the primary debugger. dbx typically interacts with the compiled program using debugging information (e.g., DWARF or STABS) generated during compilation (using options like -g). It supports a wide range of debugging commands and features, including conditional breakpoints, watchpoints, and stack tracing.

CAVEATS

dbx is less commonly used compared to gdb, therefore online resources and community support might be limited. Some advanced debugging features found in modern debuggers might be absent.

BASIC USAGE EXAMPLES

dbx program: Starts dbx to debug the specified program.
dbx program core: Starts dbx to analyze a core dump generated by the program.
Once started, commonly used commands include:
run: Start or continue program execution.
stop at line_number: Set a breakpoint at a specific line.
print variable: Print the value of a variable.
next: Step to the next line of code.
step: Step into a function call.
quit: Exit dbx.

LANGUAGE SUPPORT

dbx is primarily designed for debugging C, C++, and Fortran programs. While it may be possible to debug programs written in other languages, functionality might be limited.

HISTORY

dbx was originally developed at UC Berkeley and has evolved over time. It was a popular debugger in Unix environments before gdb gained prominence. Its development predates many modern debugging tools and reflects earlier approaches to source-level debugging.

SEE ALSO

gdb(1), lldb(1)

Copied to clipboard