diff options
author | Johannes Stoelp <johannes.stoelp@gmail.com> | 2022-09-30 12:58:18 +0200 |
---|---|---|
committer | Johannes Stoelp <johannes.stoelp@gmail.com> | 2022-09-30 12:58:18 +0200 |
commit | b6f25b16f1f23b0169e8f076e79ee4964b81db99 (patch) | |
tree | 6b5ff7a256d7c2b559e174661bfff76bf03fe3e8 | |
parent | 1bee8cd8ae939d5f818a977400daf9db6904f868 (diff) | |
download | notes-b6f25b16f1f23b0169e8f076e79ee4964b81db99.tar.gz notes-b6f25b16f1f23b0169e8f076e79ee4964b81db99.zip |
gdb: add hook example + disasm flavor + breakpoint save
-rw-r--r-- | src/tools/gdb.md | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/tools/gdb.md b/src/tools/gdb.md index 58bdccf..40dea1b 100644 --- a/src/tools/gdb.md +++ b/src/tools/gdb.md @@ -72,6 +72,9 @@ <bp_list>: Space separates list, eg 'command 2 5-8' to run command for breakpoints: 2,5,6,7,8. + + save break <file> + Save breakpoints to <file>. Can be loaded with the `source` command. ``` ## Watchpoints @@ -133,6 +136,9 @@ ## Configuration ```markdown + set disassembly-flavor <intel | att> + Set the disassembly style "flavor". + set follow-fork-mode <child | parent> Specify which process to follow when debuggee makes a fork(2) syscall. @@ -254,6 +260,20 @@ This script can be used as: gdb --batch -x ./run.gdb -p <pid> ``` +## Hook to automatically save breakpoints on `quit` +```markdown +define break-save + save breakpoint $arg0.gdb.bp +end +define break-load + source $arg0.gdb.bp +end + +define hook-quit + break-save quit +end +``` + # Know Bugs ## Workaround `command + finish` bug |