Skip to content

Commit 35f01d7

Browse files
authored
Protecting send message to debugger if it's disables (#61927)
1 parent 3efb476 commit 35f01d7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/mono/mono/component/mini-wasm-debugger.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,12 @@ extern void mono_wasm_add_dbg_command_received(mono_bool res_ok, int id, void* b
362362
EMSCRIPTEN_KEEPALIVE gboolean
363363
mono_wasm_send_dbg_command_with_parms (int id, MdbgProtCommandSet command_set, int command, guint8* data, unsigned int size, int valtype, char* newvalue)
364364
{
365+
if (!debugger_enabled) {
366+
EM_ASM ({
367+
MONO.mono_wasm_add_dbg_command_received ($0, $1, $2, $3);
368+
}, 0, id, 0, 0);
369+
return TRUE;
370+
}
365371
MdbgProtBuffer bufWithParms;
366372
buffer_init (&bufWithParms, 128);
367373
m_dbgprot_buffer_add_data (&bufWithParms, data, size);
@@ -377,6 +383,12 @@ mono_wasm_send_dbg_command_with_parms (int id, MdbgProtCommandSet command_set, i
377383
EMSCRIPTEN_KEEPALIVE gboolean
378384
mono_wasm_send_dbg_command (int id, MdbgProtCommandSet command_set, int command, guint8* data, unsigned int size)
379385
{
386+
if (!debugger_enabled) {
387+
EM_ASM ({
388+
MONO.mono_wasm_add_dbg_command_received ($0, $1, $2, $3);
389+
}, 0, id, 0, 0);
390+
return TRUE;
391+
}
380392
ss_calculate_framecount (NULL, NULL, TRUE, NULL, NULL);
381393
MdbgProtBuffer buf;
382394
buffer_init (&buf, 128);

0 commit comments

Comments
 (0)