Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wasm debug log level #34723

Merged
merged 1 commit into from
Apr 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/mono/mono/mini/mini-wasm-debugger.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ collect_frames (MonoStackFrameInfo *info, MonoContext *ctx, gpointer data)
DEBUG_PRINTF (2, "Reporting method %s native_offset %d\n", method->name, info->native_offset);

if (!mono_find_prev_seq_point_for_native_offset (mono_get_root_domain (), method, info->native_offset, NULL, &sp))
DEBUG_PRINTF (1, "Failed to lookup sequence point\n");
DEBUG_PRINTF (2, "Failed to lookup sequence point\n");

DbgEngineStackFrame *frame = g_new0 (DbgEngineStackFrame, 1);

Expand Down Expand Up @@ -335,7 +335,7 @@ mono_wasm_debugger_init (void)

mono_debug_init (MONO_DEBUG_FORMAT_MONO);
mono_de_init (&cbs);
mono_de_set_log_level (1, stdout);
mono_de_set_log_level (log_level, stdout);

mini_debug_options.gen_sdb_seq_points = TRUE;
mini_debug_options.mdb_optimizations = TRUE;
Expand All @@ -352,18 +352,19 @@ mono_wasm_debugger_init (void)
}

MONO_API void
mono_wasm_enable_debugging (void)
mono_wasm_enable_debugging (int debug_level)
{
DEBUG_PRINTF (1, "DEBUGGING ENABLED\n");
debugger_enabled = TRUE;
log_level = debug_level;
}

EMSCRIPTEN_KEEPALIVE int
mono_wasm_setup_single_step (int kind)
{
int nmodifiers = 1;

printf (">>>> mono_wasm_setup_single_step %d\n", kind);
DEBUG_PRINTF (2, ">>>> mono_wasm_setup_single_step %d\n", kind);
EventRequest *req = (EventRequest *)g_malloc0 (sizeof (EventRequest) + (nmodifiers * sizeof (Modifier)));
req->id = ++event_request_id;
req->event_kind = EVENT_KIND_STEP;
Expand Down
2 changes: 1 addition & 1 deletion src/mono/mono/mini/mini-wasm.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ typedef struct {
void mono_wasm_debugger_init (void);

// sdks/wasm/driver.c is C and uses this
G_EXTERN_C void mono_wasm_enable_debugging (void);
G_EXTERN_C void mono_wasm_enable_debugging (int log_level);

void mono_wasm_breakpoint_hit (void);
void mono_wasm_set_timeout (int timeout, int id);
Expand Down