mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #15491 from aabadie/pr/tools/qemu_debug
tools/emulator: add debug feature with qemu emulator
This commit is contained in:
commit
8b8a3ffbd9
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This script wraps Renode emulator GDB server and a debugger
|
||||
# This script wraps an emulator GDB server (renode or qemu) and a debugger
|
||||
# client in a single command and takes 4 arguments: the board to emulate,
|
||||
# the application directory of the the current application, the elffile
|
||||
# containing the firmware to debug, the debugger port and custom debugger client
|
||||
@ -42,7 +42,7 @@ trap "cleanup ${EMULATOR_PIDFILE}" EXIT
|
||||
# don't trap on Ctrl+C, because GDB keeps running
|
||||
trap '' INT
|
||||
|
||||
# start Renode GDB server
|
||||
# start emulator GDB server
|
||||
sh -c "\
|
||||
GDB_PORT=${GDB_PORT} \
|
||||
EMULATOR_PIDFILE=${EMULATOR_PIDFILE} \
|
@ -8,3 +8,14 @@ EMULATOR_FLAGS = -machine $(EMULATOR_MACHINE) -device loader,file=$(ELFFILE) \
|
||||
-serial stdio \
|
||||
-monitor $(EMULATOR_MONITOR_FLAGS) \
|
||||
-nographic
|
||||
|
||||
# Configure the debugger
|
||||
GDB_PORT ?= 3333
|
||||
QEMU_DEBUG_FLAGS += -S -gdb tcp::$(GDB_PORT)
|
||||
QEMU_DEBUG_FLAGS += $(EMULATOR_FLAGS)
|
||||
|
||||
DEBUGSERVER ?= $(EMULATOR)
|
||||
DEBUGSERVER_FLAGS ?= $(QEMU_DEBUG_FLAGS)
|
||||
|
||||
DEBUGGER_FLAGS ?= $(BOARD) $(APPDIR) $(ELFFILE) $(GDB_PORT)
|
||||
DEBUGGER ?= $(RIOTTOOLS)/emulator/debug.sh
|
||||
|
@ -28,4 +28,4 @@ DEBUGSERVER ?= $(EMULATOR)
|
||||
DEBUGSERVER_FLAGS ?= $(RENODE_DEBUG_FLAGS)
|
||||
|
||||
DEBUGGER_FLAGS ?= $(BOARD) $(APPDIR) $(ELFFILE) $(GDB_PORT) "-ex \"monitor start\""
|
||||
DEBUGGER ?= $(RIOTTOOLS)/renode/renode-debug.sh
|
||||
DEBUGGER ?= $(RIOTTOOLS)/emulator/debug.sh
|
||||
|
Loading…
Reference in New Issue
Block a user