Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
howto:gdb [2019/05/07 15:13] – [Debugging] It's supposed to be -ex and --args <sigh> - so much for consistency digital man | howto:gdb [2021/04/02 18:33] – Instructions for collecting a quick backtrace snapshot from all running threads digital man | ||
---|---|---|---|
Line 59: | Line 59: | ||
or (if debugging with a core file): | or (if debugging with a core file): | ||
# gdb / | # gdb / | ||
- | or (if attaching to an existing running instance, | + | or (if attaching to an existing running instance, |
# gdb / | # gdb / | ||
+ | or (if attaching to an existing running instance, using '' | ||
+ | # gdb -p $(pgrep sbbs) | ||
B. Run Synchronet non-daemonized (if no core file used): | B. Run Synchronet non-daemonized (if no core file used): | ||
Line 80: | Line 82: | ||
To run Synchronet (non-daemonized) directly from the GNU debugger without having to type " | To run Synchronet (non-daemonized) directly from the GNU debugger without having to type " | ||
# gdb -ex run --args sbbs -nd | # gdb -ex run --args sbbs -nd | ||
+ | |||
+ | ==== Root Access ==== | ||
+ | |||
+ | If the '' | ||
+ | |||
+ | Attaching to process 21848 | ||
+ | ptrace: Operation not permitted. | ||
+ | (gdb) | ||
+ | | ||
+ | If you get this error, try attaching again as root (e.g. run with '' | ||
==== Handling SIGPIPE ==== | ==== Handling SIGPIPE ==== | ||
Line 88: | Line 100: | ||
Alternatively, | Alternatively, | ||
handle SIGPIPE nostop noprint pass | handle SIGPIPE nostop noprint pass | ||
+ | | ||
+ | ===== Thread Snapshot ===== | ||
+ | |||
+ | To attach to a running sbbs process and quickly collect a snapshot of backtraces from all running threads (remember, obtain root privileges first, e.g. with '' | ||
+ | $ gdb -p $(pgrep sbbs) -batch -ex " | ||
===== See Also ===== | ===== See Also ===== |