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 +"""