提交 66b5f3d8 编写于 作者: A Alex Thibodeau

Caching the root domain in the mixed callstack implementation to write out on every domain reload.

When a domain reload happens the mixed callstack file gets deleted and rewritten with the jitted functions. Since the root domain is not reloaded it is no longer included in the mixed callstack file and therefore no longer resolves in the callstack window. This change caches the root callstack frames and writes them out after a domain unload occurs to ensure that these frames will display properly.
上级 b8ea873d
......@@ -8,6 +8,7 @@ static gboolean enabled;
static mono_mutex_t mutex;
static HANDLE fileHandle;
int pmipFileNum;
static GPtrArray* root_domain_frames;
#define mixed_callstack_plugin_lock() mono_os_mutex_lock (&mutex)
#define mixed_callstack_plugin_unlock() mono_os_mutex_unlock (&mutex)
......@@ -49,6 +50,8 @@ mixed_callstack_plugin_init (const char *options)
{
pmipFileNum = 0;
root_domain_frames = g_ptr_array_new();
mono_os_mutex_init_recursive(&mutex);
MonoProfilerHandle prof = mono_profiler_create(NULL);
......@@ -60,10 +63,18 @@ mixed_callstack_plugin_init (const char *options)
void
mixed_callstack_plugin_on_domain_unload_end()
{
if(!enabled)
if (!enabled)
return;
create_next_pmip_file();
long bytesWritten = 0;
// ensure root domain is represented
mixed_callstack_plugin_lock();
for (int i = 0; i < root_domain_frames->len; i++)
{
WriteFile(fileHandle, root_domain_frames->pdata[i], strlen(root_domain_frames->pdata[i]), &bytesWritten, NULL);
}
mixed_callstack_plugin_unlock();
}
void
......@@ -86,6 +97,11 @@ mixed_callstack_plugin_save_method_info (MonoCompile *cfg)
mixed_callstack_plugin_lock ();
WriteFile(fileHandle, frame, bytes, &bytesWritten, NULL);
if (cfg->domain == mono_get_root_domain())
{
char* tFrame = g_strdup(frame);
g_ptr_array_add(root_domain_frames, tFrame);
}
mixed_callstack_plugin_unlock ();
g_free(method_name);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册