From b139756457b4ba82db773e0114e0684dc1cefdfe Mon Sep 17 00:00:00 2001 From: Konstantin Aladyshev Date: Mon, 19 Jul 2021 18:48:06 +0300 Subject: Update GDB cheatsheet Signed-off-by: Konstantin Aladyshev --- Lessons/Lesson_42/README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Lessons/Lesson_42/README.md b/Lessons/Lesson_42/README.md index 389bf44..1074dfe 100644 --- a/Lessons/Lesson_42/README.md +++ b/Lessons/Lesson_42/README.md @@ -373,6 +373,22 @@ In the end `run_gdb_ovmf.sh` would provide similar `tmux` session. The only diff - `d ` - delete breakpoint `` - `c` - continue - `q` - quit GDB +- `Ctrl+p` - previous GDB command in history +- `Ctrl+n` - next GDB command in history +- `Ctrl+x` and `o` - change active window in tui mode + +To print CHAR16 string you can use `x /sh ` command. Here is the example how can you print device path: +``` +(gdb) p ConvertDevicePathToText(DevicePath, 0, 1) +$1 = (CHAR16 *) 0x6d04518 +(gdb) x /sh 0x6d04518 +0x6d04518: u"PciRoot(0x0)/Pci(0x2,0x0)" +``` +You can even do it in one command: +``` +(gdb) x /sh ConvertDevicePathToText(DevicePath, 0, 1) +0x6d02098: u"PciRoot(0x0)/Pci(0x2,0x0)" +``` # Minimal Tmux cheatsheet -- cgit v1.2.3-18-g5258