From 96d337388b22aea0e8f1a1a728e017b05c470649 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 27 Jun 2019 15:07:13 +0300 Subject: [PATCH] Debug: Initial configuration for QEMU --- platformio/commands/debug/client.py | 2 ++ platformio/commands/debug/initcfgs.py | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/platformio/commands/debug/client.py b/platformio/commands/debug/client.py index a7ed9b2b..9b208a48 100644 --- a/platformio/commands/debug/client.py +++ b/platformio/commands/debug/client.py @@ -119,6 +119,8 @@ class GDBClient(BaseProcess): # pylint: disable=too-many-instance-attributes cfg = initcfgs.GDB_STUTIL_INIT_CONFIG elif "mspdebug" in server_exe: cfg = initcfgs.GDB_MSPDEBUG_INIT_CONFIG + elif "qemu" in server_exe: + cfg = initcfgs.GDB_QEMU_INIT_CONFIG elif self.debug_options['require_debug_port']: cfg = initcfgs.GDB_BLACKMAGIC_INIT_CONFIG else: diff --git a/platformio/commands/debug/initcfgs.py b/platformio/commands/debug/initcfgs.py index 658418ae..a9d71d32 100644 --- a/platformio/commands/debug/initcfgs.py +++ b/platformio/commands/debug/initcfgs.py @@ -107,3 +107,18 @@ monitor erase $LOAD_CMDS pio_reset_halt_target """ + +GDB_QEMU_INIT_CONFIG = """ +define pio_reset_halt_target + monitor system_reset +end + +define pio_reset_target + pio_reset_halt_target +end + +target extended-remote $DEBUG_PORT +$INIT_BREAK +$LOAD_CMDS +pio_reset_halt_target +"""