mirror of
https://github.com/kichikuou/xsystem35-sdl2.git
synced 2026-10-01 19:28:00 +03:00
debugger_dap: Fail to Initialize if debug symbol file is not available
This commit is contained in:
+1
-2
@@ -46,9 +46,8 @@ static struct {
|
||||
|
||||
void dbg_init(const char *symbols_path, boolean use_dap) {
|
||||
dbg_impl = use_dap ? &dbg_dap_impl : &dbg_cui_impl;
|
||||
dbg_impl->init();
|
||||
dbg_impl->init(symbols_path);
|
||||
dbg_state = DBG_STOPPED_ENTRY;
|
||||
symbols = dsym_load(symbols_path);
|
||||
}
|
||||
|
||||
void dbg_quit() {
|
||||
|
||||
+2
-1
@@ -323,7 +323,8 @@ static void sigint_handler(int sig_num) {
|
||||
dbg_state = DBG_STOPPED_INTERRUPT;
|
||||
}
|
||||
|
||||
static void dbg_cui_init(void) {
|
||||
static void dbg_cui_init(const char *symbols_path) {
|
||||
symbols = dsym_load(symbols_path);
|
||||
#ifdef HAVE_SIGACTION
|
||||
sys_set_signalhandler(SIGINT, sigint_handler);
|
||||
#endif
|
||||
|
||||
+8
-1
@@ -112,6 +112,11 @@ static void emit_output_event(const char *output) {
|
||||
}
|
||||
|
||||
static void cmd_initialize(cJSON *args, cJSON *resp) {
|
||||
if (!symbols) {
|
||||
cJSON_AddBoolToObject(resp, "success", false);
|
||||
cJSON_AddStringToObject(resp, "message", "xsystem35: Cannot load debug symbols");
|
||||
return;
|
||||
}
|
||||
cJSON *body;
|
||||
cJSON_AddBoolToObject(resp, "success", true);
|
||||
cJSON_AddItemToObjectCS(resp, "body", body = cJSON_CreateObject());
|
||||
@@ -555,7 +560,7 @@ static int read_command_thread(void *data) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void dbg_dap_init(void) {
|
||||
static void dbg_dap_init(const char *symbols_path) {
|
||||
cmd_queue.mutex = SDL_CreateMutex();
|
||||
cmd_queue.cond_nonempty = SDL_CreateCond();
|
||||
|
||||
@@ -566,6 +571,8 @@ static void dbg_dap_init(void) {
|
||||
|
||||
SDL_CreateThread(read_command_thread, "Debugger", NULL);
|
||||
|
||||
symbols = dsym_load(symbols_path);
|
||||
|
||||
while (!initialized) {
|
||||
char *msg = cmdq_dequeue();
|
||||
if (!msg)
|
||||
|
||||
@@ -48,7 +48,7 @@ typedef struct {
|
||||
} StackTrace;
|
||||
|
||||
typedef struct {
|
||||
void (*init)(void);
|
||||
void (*init)(const char *symbols_path);
|
||||
void (*quit)(void);
|
||||
void (*repl)(void);
|
||||
void (*onsleep)(void);
|
||||
|
||||
Reference in New Issue
Block a user