From ea5d1e530db755211fb848be48b8ce844a65dcec Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Wed, 28 Oct 2020 00:08:33 +0100 Subject: [PATCH] gdb: add more cmd and history stuff --- .gdbinit | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.gdbinit b/.gdbinit index 356091c..522d31b 100644 --- a/.gdbinit +++ b/.gdbinit @@ -9,3 +9,19 @@ define exit kill quit end + +define xxd + dump binary memory /tmp/dump.bin $arg0 ((char *)$arg0)+$arg1 + shell xxd /tmp/dump.bin +end +document xxd + Runs xxd on a memory ADDR and LENGTH + + xxd ADDR LENTH +end + +macro define offsetof(t, f) &((t *) 0)->f + +set history save on +set history size 10000 +set history filename ~/.gdb_history