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)