mirror of
https://github.com/kichikuou/xsystem35-sdl2.git
synced 2026-10-03 04:08:00 +03:00
debugger_dap: Ask frontend to restart xsystem35 on sysReset command
This commit is contained in:
+10
-4
@@ -81,10 +81,14 @@ static void emit_initialized_event(void) {
|
||||
send_json(event);
|
||||
}
|
||||
|
||||
static void emit_terminated_event(void) {
|
||||
cJSON *event = cJSON_CreateObject();
|
||||
static void emit_terminated_event(bool restart) {
|
||||
cJSON *event = cJSON_CreateObject(), *body;
|
||||
cJSON_AddStringToObject(event, "type", "event");
|
||||
cJSON_AddStringToObject(event, "event", "terminated");
|
||||
if (restart) {
|
||||
cJSON_AddItemToObjectCS(event, "body", body = cJSON_CreateObject());
|
||||
cJSON_AddBoolToObject(body, "restart", true);
|
||||
}
|
||||
send_json(event);
|
||||
}
|
||||
|
||||
@@ -584,8 +588,10 @@ static void dbg_dap_init(const char *path) {
|
||||
}
|
||||
}
|
||||
|
||||
static void dbg_dap_quit(void) {
|
||||
emit_terminated_event();
|
||||
static void dbg_dap_quit(bool restart) {
|
||||
emit_terminated_event(restart);
|
||||
if (restart)
|
||||
exit(0); // The front end will restart xsystem35, so we can just exit.
|
||||
}
|
||||
|
||||
static void dbg_dap_repl(void) {
|
||||
|
||||
Reference in New Issue
Block a user