From b6f25b16f1f23b0169e8f076e79ee4964b81db99 Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Fri, 30 Sep 2022 12:58:18 +0200 Subject: gdb: add hook example + disasm flavor + breakpoint save --- src/tools/gdb.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src') 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 @@ : Space separates list, eg 'command 2 5-8' to run command for breakpoints: 2,5,6,7,8. + + save break + Save breakpoints to . Can be loaded with the `source` command. ``` ## Watchpoints @@ -133,6 +136,9 @@ ## Configuration ```markdown + set disassembly-flavor + Set the disassembly style "flavor". + set follow-fork-mode 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 ``` +## 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 -- cgit v1.2.3