diff --git a/src/mono/mono/eventpipe/ep-rt-mono.c b/src/mono/mono/eventpipe/ep-rt-mono.c index a75f7ca5fedb3..ad5d7c67ba92c 100644 --- a/src/mono/mono/eventpipe/ep-rt-mono.c +++ b/src/mono/mono/eventpipe/ep-rt-mono.c @@ -3784,7 +3784,17 @@ get_module_event_data ( if (image && image->aot_module) module_data->module_flags |= MODULE_FLAGS_NATIVE_MODULE; - module_data->module_il_path = image && image->filename ? image->filename : (image && image->name ? image->name : ""); + module_data->module_il_path = NULL; + if (image && image->filename) { + /* if there's a filename, use it */ + module_data->module_il_path = image->filename; + } else if (image && image->module_name) { + /* otherwise, use the module name */ + module_data->module_il_path = image->module_name; + } + if (!module_data->module_il_path) + module_data->module_il_path = ""; + module_data->module_il_pdb_path = ""; module_data->module_il_pdb_age = 0;