Skip to content

Commit

Permalink
[wasm][debugger] Support sending Assembly_Load events on wasm (#100941)
Browse files Browse the repository at this point in the history
* Support sending Assembly_Load events  on wasm

* Update debugger-agent.c

update other assembly_load reference

---------

Co-authored-by: Larry Ewing <lewing@microsoft.com>
  • Loading branch information
thaystg and lewing committed Apr 12, 2024
1 parent be3ad0d commit f02db51
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
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

0 comments on commit f02db51

Please sign in to comment.