From b14165fda770d97371a98548767b35a6f13ce5a7 Mon Sep 17 00:00:00 2001 From: Daniel Yang Date: Wed, 15 Nov 2023 18:55:45 -0800 Subject: [PATCH 1/4] made changes to makefile for gef --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 1ab9c40..673ef85 100644 --- a/Makefile +++ b/Makefile @@ -51,6 +51,9 @@ image: boot kernel run: default $(QEMU) -drive format=raw,file=$(BUILD_DIR)/os_image +gdb: default + $(QEMU) -drive format=raw,file=$(BUILD_DIR)/os_image -s -S & gdb -x "~/.config/gefremote" build/kernel.elf + dockerun: $(QEMU) -drive format=raw,file=$(BUILD_DIR)/os_image From 1fc34e8970bcbdbae8be53d55a033b03dadc5b44 Mon Sep 17 00:00:00 2001 From: Daniel Yang Date: Wed, 15 Nov 2023 19:00:35 -0800 Subject: [PATCH 2/4] made changes --- Makefile | 4 +++- config/gefremote | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 config/gefremote diff --git a/Makefile b/Makefile index 673ef85..38a8a3f 100644 --- a/Makefile +++ b/Makefile @@ -9,9 +9,11 @@ OBJCOPY=$(PREFIX)-objcopy BUILD_DIR=build SRC_DIR=source +CONF_DIR=config KERNEL_DIR=$(SRC_DIR)/kernel BOOT_DIR=$(SRC_DIR)/boot LIBC_DIR=$(SRC_DIR)/libc +GEF_CONFIG=$(CONF_DIR)/gefremote INCLUDES=$(KERNEL_DIR)/include LIBC=$(LIBC_DIR)/include @@ -52,7 +54,7 @@ run: default $(QEMU) -drive format=raw,file=$(BUILD_DIR)/os_image gdb: default - $(QEMU) -drive format=raw,file=$(BUILD_DIR)/os_image -s -S & gdb -x "~/.config/gefremote" build/kernel.elf + $(QEMU) -drive format=raw,file=$(BUILD_DIR)/os_image -s -S & gdb -x $(GEF_CONFIG) build/kernel.elf dockerun: $(QEMU) -drive format=raw,file=$(BUILD_DIR)/os_image diff --git a/config/gefremote b/config/gefremote new file mode 100644 index 0000000..b1096c5 --- /dev/null +++ b/config/gefremote @@ -0,0 +1 @@ +gef-remote --qemu-user --qemu-binary build/kernel.elf localhost 1234 \ No newline at end of file From 34bfe1f1fdfbdf284bb9d74b5d14960327230ae8 Mon Sep 17 00:00:00 2001 From: Aplet123 Date: Wed, 15 Nov 2023 19:04:04 -0800 Subject: [PATCH 3/4] Revert bad commit This reverts commit 1fc34e8970bcbdbae8be53d55a033b03dadc5b44. --- Makefile | 4 +--- config/gefremote | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 config/gefremote diff --git a/Makefile b/Makefile index 38a8a3f..673ef85 100644 --- a/Makefile +++ b/Makefile @@ -9,11 +9,9 @@ OBJCOPY=$(PREFIX)-objcopy BUILD_DIR=build SRC_DIR=source -CONF_DIR=config KERNEL_DIR=$(SRC_DIR)/kernel BOOT_DIR=$(SRC_DIR)/boot LIBC_DIR=$(SRC_DIR)/libc -GEF_CONFIG=$(CONF_DIR)/gefremote INCLUDES=$(KERNEL_DIR)/include LIBC=$(LIBC_DIR)/include @@ -54,7 +52,7 @@ run: default $(QEMU) -drive format=raw,file=$(BUILD_DIR)/os_image gdb: default - $(QEMU) -drive format=raw,file=$(BUILD_DIR)/os_image -s -S & gdb -x $(GEF_CONFIG) build/kernel.elf + $(QEMU) -drive format=raw,file=$(BUILD_DIR)/os_image -s -S & gdb -x "~/.config/gefremote" build/kernel.elf dockerun: $(QEMU) -drive format=raw,file=$(BUILD_DIR)/os_image diff --git a/config/gefremote b/config/gefremote deleted file mode 100644 index b1096c5..0000000 --- a/config/gefremote +++ /dev/null @@ -1 +0,0 @@ -gef-remote --qemu-user --qemu-binary build/kernel.elf localhost 1234 \ No newline at end of file From 2e1281c5ac00f754689f3209bd84744ca1a5bd81 Mon Sep 17 00:00:00 2001 From: Aplet123 Date: Wed, 15 Nov 2023 19:05:34 -0800 Subject: [PATCH 4/4] inline gdb config --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 673ef85..e091959 100644 --- a/Makefile +++ b/Makefile @@ -52,7 +52,8 @@ run: default $(QEMU) -drive format=raw,file=$(BUILD_DIR)/os_image gdb: default - $(QEMU) -drive format=raw,file=$(BUILD_DIR)/os_image -s -S & gdb -x "~/.config/gefremote" build/kernel.elf + # Need to have GEF installed for this to work + $(QEMU) -drive format=raw,file=$(BUILD_DIR)/os_image -s -S & gdb -ex "gef-remote --qemu-user localhost 1234" build/kernel.elf dockerun: $(QEMU) -drive format=raw,file=$(BUILD_DIR)/os_image