diff options
author | Johannes Stoelp <johannes.stoelp@gmail.com> | 2023-06-26 21:22:56 +0200 |
---|---|---|
committer | Johannes Stoelp <johannes.stoelp@gmail.com> | 2023-06-26 21:22:56 +0200 |
commit | 666d80e2586b302239e49deb62b5418160b6dd9d (patch) | |
tree | a92419c97a5619e65c5b0587b83dbf0c262232a0 /src/tools | |
parent | 35dc3c48a50594148554010ac626480161ad357a (diff) | |
download | notes-666d80e2586b302239e49deb62b5418160b6dd9d.tar.gz notes-666d80e2586b302239e49deb62b5418160b6dd9d.zip |
gdb: example to set bp on all threads but one, show convenience vars
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/gdb.md | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/tools/gdb.md b/src/tools/gdb.md index d0191af..5ae9062 100644 --- a/src/tools/gdb.md +++ b/src/tools/gdb.md @@ -223,6 +223,14 @@ Create conditional breakpoints for a function `void foo(int i)` in the debugee. cond 2 if i == 7 ``` +## Set breakpoint on all threads except one +Create conditional breakpoint using the `$_thread` [convenience +variable][gdb-convenience-vars]. +```markdown + # Create conditional breakpoint on all threads except thread 12. + b foo if $_thread != 12 +``` + ## Catch SIGSEGV and execute commands This creates a `catchpoint` for the `SIGSEGV` signal and attached the `command` to it. @@ -364,3 +372,5 @@ executed. To workaround that bug one can create a wrapper function which calls handler end ``` + +[gdb-convenience-vars]: https://sourceware.org/gdb/onlinedocs/gdb/Convenience-Vars.html#Convenience-Vars |