From be13e26586bb5fb7692ee9b772ff7a0b16fb65bc Mon Sep 17 00:00:00 2001 From: Andrew Boie Date: Thu, 23 Jun 2016 11:33:55 -0700 Subject: [PATCH] build: add 'qemugdb' target This new target works much like 'make qemu' but fires up a local GDB server on port 1234 and pauses execution Change-Id: I87fd174c66dcc9f2f43b5b1204cc5c34f741622d Signed-off-by: Andrew Boie --- Makefile | 4 ++++ Makefile.inc | 3 +++ 2 files changed, 7 insertions(+) diff --git a/Makefile b/Makefile index aff7b944269..5acd56b5a47 100644 --- a/Makefile +++ b/Makefile @@ -1050,6 +1050,7 @@ help: @echo ' all - Build all targets marked with [*]' @echo '* zephyr - Build a zephyr application' @echo ' qemu - Build a zephyr application and run it in qemu' + @echo ' qemugdb - Same as 'qemu' but start a GDB server on port 1234' @echo ' flash - Build and flash an application' @echo ' debug - Build and debug an application using GDB' @echo '' @@ -1168,6 +1169,9 @@ qemu: zephyr $(if $(CONFIG_X86_IAMCU),python $(ZEPHYR_BASE)/scripts/qemu-machine-hack.py $(KERNEL_ELF_NAME)) $(Q)$(QEMU) $(QEMU_FLAGS) $(QEMU_EXTRA_FLAGS) -kernel $(KERNEL_ELF_NAME) +qemugdb: QEMU_EXTRA_FLAGS += -s -S +qemugdb: qemu + -include $(srctree)/boards/$(BOARD_NAME)/Makefile.board ifneq ($(FLASH_SCRIPT),) flash: zephyr diff --git a/Makefile.inc b/Makefile.inc index 8faee89aeb3..289f9b67756 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -75,9 +75,12 @@ all: $(DOTCONFIG) ifeq ($(findstring qemu_,$(BOARD)),) qemu: @echo "Emulation not available for this platform" +qemugdb: qemu else qemu: $(DOTCONFIG) $(Q)$(call zephyrmake,$(O),$@) +qemugdb: $(DOTCONFIG) + $(Q)$(call zephyrmake,$(O),$@) endif debug: $(DOTCONFIG)