error::sdt - Linux
Overview
error::sdt is a command-line tool used for source-level debugging of software. It provides detailed error messages and stack traces for errors encountered during the execution of a program. error::sdt is especially useful for debugging multithreaded applications, where traditional debugging techniques can be challenging.
Syntax
error::sdt [options] [program] [arguments]
Options/Flags
- -h, –help: Display help and usage information.
- -d, –debug-level: Set the debug level. Higher levels provide more detailed error information.
- -t, –thread-id: Specify a specific thread ID to debug.
- -s, –stack-trace: Print a stack trace for each error.
- -m, –message: Display only the error message.
- -j, –json: Output error information in JSON format.
- -o, –output-file: Specify an output file for error information.
Examples
Simple Usage:
error::sdt ./myprogram
Debugging a specific thread:
error::sdt -t 42 ./myprogram
Outputting error information to a file:
error::sdt -o errors.log ./myprogram
Common Issues
- No errors are being reported: Make sure the program being debugged is compiled with error detection enabled.
- Too much error information: Adjust the debug level using the
-d
option to reduce the amount of output. - Stack traces are missing: Ensure that the program is built with debug symbols.
Integration
error::sdt can be integrated with other Linux commands and tools, such as:
- g++: Use the
-g
flag to compile your program with debug symbols enabled. - gdb: Use the
run
command within gdb to execute your program with error::sdt.
Related Commands
- gdb: A powerful debugger used for low-level debugging.
- dtruss: A tool for tracing system calls and library functions.
- strace: A tool for tracing system calls.