1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

makefiles/tools: define DEBUG_ELFFILE and use it for debugging

This commit is contained in:
Benjamin Valentin 2022-05-31 12:39:16 +02:00
parent 1925c99436
commit 1111631c45
12 changed files with 14 additions and 11 deletions

View File

@ -670,6 +670,9 @@ ifneq (,$(filter suit,$(USEMODULE)))
include $(RIOTMAKE)/suit.inc.mk
endif
# elf file used for the debugger, must include bootloader offset
DEBUG_ELFFILE ?= $(ELFFILE)
# Targets to get given file
elffile: $(ELFFILE)
hexfile: $(HEXFILE)

View File

@ -13,4 +13,4 @@ DEBUGSERVER = st-util
# define st-flash parameters
FLASHFILE ?= $(BINFILE)
FFLAGS = write $(FLASHFILE) 0x8000000
DEBUGGER_FLAGS = $(RIOTBOARD)/f4vi1/dist/gdb.conf $(ELFFILE)
DEBUGGER_FLAGS = $(RIOTBOARD)/f4vi1/dist/gdb.conf $(DEBUG_ELFFILE)

View File

@ -7,7 +7,7 @@ OPENOCD_CORE = stm32mp15x.cm4
GDB_PORT_CORE_OFFSET = 1
FFLAGS ?= flashr $(FLASHFILE)
DEBUGGER_FLAGS ?= debugr $(ELFFILE)
DEBUGGER_FLAGS ?= debugr $(DEBUG_ELFFILE)
# Setup of programmer and serial is shared between STM32 based boards
include $(RIOTMAKE)/boards/stm32.inc.mk

View File

@ -16,7 +16,7 @@ else
DEBUGPROTO ?= -j $(AVR_DEBUGINTERFACE)
endif
DEBUGSERVER_FLAGS ?= "$(AVR_DEBUGDEVICE) $(DEBUGPROTO) :$(DEBUGSERVER_PORT)"
DEBUGGER_FLAGS ?= "-x $(AVARICE_PATH)/gdb.conf $(ELFFILE)"
DEBUGGER_FLAGS ?= "-x $(AVARICE_PATH)/gdb.conf $(DEBUG_ELFFILE)"
DEBUGGER = "$(AVARICE_PATH)/debug.sh" $(DEBUGSERVER_FLAGS) $(AVARICE_PATH) $(DEBUGSERVER_PORT)
ifeq (atxmega,$(CPU))

View File

@ -5,5 +5,5 @@ RESET ?= $(RIOTTOOLS)/bmp/bmp.py
FLASHFILE ?= $(ELFFILE)
FFLAGS ?= $(BMP_OPTIONS) flash $(FLASHFILE)
DEBUGGER_FLAGS ?= $(BMP_OPTIONS) debug $(ELFFILE)
DEBUGGER_FLAGS ?= $(BMP_OPTIONS) debug $(DEBUG_ELFFILE)
RESET_FLAGS ?= $(BMP_OPTIONS) reset

View File

@ -6,7 +6,7 @@ RESET ?= $(RIOTTOOLS)/jlink/jlink.sh
FLASHFILE ?= $(BINFILE)
FFLAGS ?= flash $(FLASHFILE)
DEBUGGER_FLAGS ?= debug $(ELFFILE)
DEBUGGER_FLAGS ?= debug $(DEBUG_ELFFILE)
DEBUGSERVER_FLAGS ?= debug-server
RESET_FLAGS ?= reset

View File

@ -10,7 +10,7 @@ FFLAGS = $(MSPDEBUGFLAGS) "prog $(FLASHFILE)"
DEBUGSERVER = $(FLASHER)
DEBUGSERVER_FLAGS = $(MSPDEBUGFLAGS) gdb
DEBUGGER = $(PREFIX)gdb
DEBUGGER_FLAGS = --ex="target remote localhost:2000" --ex "monitor reset halt" --ex load -ex "monitor reset halt" $(ELFFILE)
DEBUGGER_FLAGS = --ex="target remote localhost:2000" --ex "monitor reset halt" --ex load -ex "monitor reset halt" $(DEBUG_ELFFILE)
# setup reset tool
RESET ?= mspdebug

View File

@ -5,7 +5,7 @@ RESET ?= $(RIOTTOOLS)/openocd/openocd.sh
FLASHFILE ?= $(ELFFILE)
FFLAGS ?= flash $(FLASHFILE)
DEBUGGER_FLAGS ?= debug $(ELFFILE)
DEBUGGER_FLAGS ?= debug $(DEBUG_ELFFILE)
DEBUGSERVER_FLAGS ?= debug-server
RESET_FLAGS ?= reset

View File

@ -6,7 +6,7 @@ RESET ?= $(RIOTBASE)/dist/tools/pyocd/pyocd.sh
PYOCD_FLASH_TARGET_TYPE ?=
FLASHFILE ?= $(HEXFILE)
FFLAGS ?= flash $(FLASHFILE)
DEBUGGER_FLAGS ?= debug $(ELFFILE)
DEBUGGER_FLAGS ?= debug $(DEBUG_ELFFILE)
DEBUGSERVER_FLAGS ?= debug-server
RESET_FLAGS ?= reset

View File

@ -33,7 +33,7 @@ QEMU_DEBUG_FLAGS += $(EMULATOR_FLAGS)
DEBUGSERVER ?= $(EMULATOR)
DEBUGSERVER_FLAGS ?= $(QEMU_DEBUG_FLAGS)
DEBUGGER_FLAGS ?= $(BOARD) $(APPDIR) $(ELFFILE) $(GDB_REMOTE) $(EMULATOR_TMP_DIR)
DEBUGGER_FLAGS ?= $(BOARD) $(APPDIR) $(DEBUG_ELFFILE) $(GDB_REMOTE) $(EMULATOR_TMP_DIR)
DEBUGGER ?= $(RIOTTOOLS)/emulator/debug.sh
# No flasher available with qemu emulator

View File

@ -59,7 +59,7 @@ RENODE_DEBUG_FLAGS += -e "machine StartGdbServer $(GDB_PORT) true"
DEBUGSERVER ?= $(EMULATOR)
DEBUGSERVER_FLAGS ?= $(RENODE_DEBUG_FLAGS)
DEBUGGER_FLAGS ?= $(BOARD) $(APPDIR) $(ELFFILE) $(GDB_REMOTE) $(EMULATOR_TMP_DIR) "-ex \"monitor start\""
DEBUGGER_FLAGS ?= $(BOARD) $(APPDIR) $(DEBUG_ELFFILE) $(GDB_REMOTE) $(EMULATOR_TMP_DIR) "-ex \"monitor start\""
DEBUGGER ?= $(RIOTTOOLS)/emulator/debug.sh
# No flasher available with renode emulator

View File

@ -34,4 +34,4 @@ DEBUGSERVER_FLAGS ?= -p 3333 $(UNIFLASH_CONFIG_DAT)
# configure the debugging tool
DEBUGGER ?= $(PREFIX)gdb
DEBUGGER_FLAGS ?= -x $(UNIFLASH_CONFIG_GDB) $(ELFFILE)
DEBUGGER_FLAGS ?= -x $(UNIFLASH_CONFIG_GDB) $(DEBUG_ELFFILE)