From 6ddcf19a0605cc37f33d86408c358576a525e5c7 Mon Sep 17 00:00:00 2001 From: Alexander Myltsev Date: Fri, 25 Nov 2022 09:57:00 +0000 Subject: [PATCH] GDB var. --- Makefile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index d9aabf3..ee34527 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,18 @@ +GDB=gdb + ifeq ($(shell uname -s),Darwin) AS=x86_64-elf-as LD=x86_64-elf-ld CC=x86_64-elf-gcc +GDB=x86_64-elf-gdb endif run: image.bin qemu-system-i386 -drive format=raw,file=$< -serial mon:stdio -debug-preboot: image.bin mbr.elf - qemu-system-i386 -drive format=raw,file=$< -s -S & - x86_64-elf-gdb mbr.elf \ +debug-preboot-nox: image.bin mbr.elf + qemu-system-i386 -nographic -drive format=raw,file=$< -s -S & + $(GDB) mbr.elf \ -ex "set architecture i8086" \ -ex "target remote localhost:1234" \ -ex "break *0x7c00" \ @@ -17,14 +20,14 @@ debug-preboot: image.bin mbr.elf debug-boot: image.bin mbr.elf qemu-system-i386 -drive format=raw,file=$< -s -S & - x86_64-elf-gdb mbr.elf \ + $(GDB) mbr.elf \ -ex "target remote localhost:1234" \ -ex "break init_32bit" \ -ex "continue" debug: image.bin qemu-system-i386 -drive format=raw,file=$< -s -S & - x86_64-elf-gdb kernel.bin \ + $(GDB) kernel.bin \ -ex "target remote localhost:1234" \ -ex "break _start" \ -ex "continue"