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][debugger] Support sending Assembly_Load events on wasm #100941

Merged
merged 2 commits into from
Apr 12, 2024
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
10 changes: 4 additions & 6 deletions src/mono/mono/component/debugger-agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,6 @@ static void emit_thread_start (gpointer key, gpointer value, gpointer user_data)

static void invalidate_each_thread (gpointer key, gpointer value, gpointer user_data);

static void assembly_load (MonoProfiler *prof, MonoAssembly *assembly);

static void assembly_unload (MonoProfiler *prof, MonoAssembly *assembly);

static void gc_finalizing (MonoProfiler *prof);
Expand Down Expand Up @@ -804,7 +802,7 @@ mono_debugger_agent_init_internal (void)
mono_profiler_set_domain_loaded_callback (prof, appdomain_load);
mono_profiler_set_domain_unloading_callback (prof, appdomain_start_unload);
mono_profiler_set_domain_unloaded_callback (prof, appdomain_unload);
mono_profiler_set_assembly_loaded_callback (prof, assembly_load);
mono_profiler_set_assembly_loaded_callback (prof, mono_dbg_assembly_load);
mono_profiler_set_assembly_unloading_callback (prof, assembly_unload);
mono_profiler_set_jit_failed_callback (prof, jit_failed);
mono_profiler_set_gc_finalizing_callback (prof, gc_finalizing);
Expand Down Expand Up @@ -4005,8 +4003,8 @@ invalidate_each_thread (gpointer key, gpointer value, gpointer user_data)
invalidate_frames ((DebuggerTlsData *)value);
}

static void
assembly_load (MonoProfiler *prof, MonoAssembly *assembly)
void
mono_dbg_assembly_load (MonoProfiler *prof, MonoAssembly *assembly)
{
/* Sent later in jit_end () */
dbg_lock ();
Expand Down Expand Up @@ -4127,7 +4125,7 @@ jit_end (MonoProfiler *prof, MonoMethod *method, MonoJitInfo *jinfo)
if (!CHECK_ICORDBG (TRUE) || tls->invoke == NULL) {
process_profiler_event (EVENT_KIND_ASSEMBLY_LOAD, assembly);
} else {
assembly_load(prof, assembly); //send later
mono_dbg_assembly_load (prof, assembly); //send later
break;
}
} else {
Expand Down
3 changes: 3 additions & 0 deletions src/mono/mono/component/debugger-agent.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,7 @@ mono_debugger_agent_receive_and_process_command (void);

bool
mono_begin_breakpoint_processing (void *the_tls, MonoContext *ctx, MonoJitInfo *ji, gboolean from_signal);

void
mono_dbg_assembly_load (MonoProfiler *prof, MonoAssembly *assembly);
#endif
1 change: 1 addition & 0 deletions src/mono/mono/component/mini-wasm-debugger.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ static void
assembly_loaded (MonoProfiler *prof, MonoAssembly *assembly)
{
PRINT_DEBUG_MSG (2, "assembly_loaded callback called for %s\n", assembly->aname.name);
mono_dbg_assembly_load (prof, assembly);
MonoImage *assembly_image = assembly->image;
MonoImage *pdb_image = NULL;

Expand Down
Loading