diff --git a/src/helper/startup.tcl b/src/helper/startup.tcl index d3ddb30c0..acc4d318a 100644 --- a/src/helper/startup.tcl +++ b/src/helper/startup.tcl @@ -152,3 +152,8 @@ proc script {filename} { add_help_text script " - filename of OpenOCD script (tcl) to run" + +# Handle GDB 'R' packet. Can be overriden by configuration script +proc gdb_restart {} { + reset halt +} \ No newline at end of file diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index 665e3507a..e964a1d51 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -1950,8 +1950,7 @@ int gdb_input_inner(connection_t *connection) break; case 'R': /* handle extended restart packet */ - /* fix?? make this configurable? */ - target_process_reset(connection->cmd_ctx, RESET_HALT); + command_run_linef(connection->cmd_ctx, "gdb_restart"); break; default: /* ignore unkown packets */