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 <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2016-06-23 11:33:55 -07:00
parent 54b58827b0
commit be13e26586
2 changed files with 7 additions and 0 deletions

View File

@ -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

View File

@ -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)