mono_debugger_event (MONO_DEBUGGER_EVENT_JIT_BREAKPOINT, (guint64) (gsize) method, index);
}
-void
-mono_debugger_thread_created (gsize tid, MonoThread *thread, MonoJitTlsData *jit_tls, gpointer func)
-{
-#ifdef MONO_DEBUGGER_SUPPORTED
- size_t stsize = 0;
- guint8 *staddr = NULL;
- MonoDebuggerThreadInfo *info;
-
- if (mono_debug_format == MONO_DEBUG_FORMAT_NONE)
- return;
-
- mono_debugger_lock ();
-
- mono_thread_get_stack_bounds (&staddr, &stsize);
-
- info = g_new0 (MonoDebuggerThreadInfo, 1);
- info->tid = tid;
- info->thread = thread->internal_thread;
- info->stack_start = (guint64) (gsize) staddr;
- info->signal_stack_start = (guint64) (gsize) jit_tls->signal_stack;
- info->stack_size = stsize;
- info->signal_stack_size = jit_tls->signal_stack_size;
- info->end_stack = (guint64) (gsize) GC_mono_debugger_get_stack_ptr ();
- info->lmf_addr = (guint64) (gsize) mono_get_lmf_addr ();
- info->jit_tls = jit_tls;
-
- if (func)
- info->thread_flags = MONO_DEBUGGER_THREAD_FLAGS_INTERNAL;
- if (thread->internal_thread->threadpool_thread)
- info->thread_flags |= MONO_DEBUGGER_THREAD_FLAGS_THREADPOOL;
-
- info->next = mono_debugger_thread_table;
- mono_debugger_thread_table = info;
-
- mono_debugger_event (MONO_DEBUGGER_EVENT_THREAD_CREATED,
- tid, (guint64) (gsize) info);
-
- mono_debugger_unlock ();
-#endif /* MONO_DEBUGGER_SUPPORTED */
-}
-
-void
-mono_debugger_thread_cleanup (MonoJitTlsData *jit_tls)
-{
-#ifdef MONO_DEBUGGER_SUPPORTED
- MonoDebuggerThreadInfo **ptr;
-
- if (mono_debug_format == MONO_DEBUG_FORMAT_NONE)
- return;
-
- mono_debugger_lock ();
-
- for (ptr = &mono_debugger_thread_table; *ptr; ptr = &(*ptr)->next) {
- MonoDebuggerThreadInfo *info = *ptr;
-
- if (info->jit_tls != jit_tls)
- continue;
-
- mono_debugger_event (MONO_DEBUGGER_EVENT_THREAD_CLEANUP,
- info->tid, (guint64) (gsize) info);
-
- *ptr = info->next;
- g_free (info);
- break;
- }
-
- mono_debugger_unlock ();
-#endif
-}
-
-void
-mono_debugger_extended_notification (MonoDebuggerEvent event, guint64 data, guint64 arg)
-{
-#ifdef MONO_DEBUGGER_SUPPORTED
- MonoDebuggerThreadInfo **ptr;
- MonoInternalThread *thread = mono_thread_internal_current ();
-
- if (!mono_debug_using_mono_debugger ())
- return;
-
- mono_debugger_lock ();
-
- for (ptr = &mono_debugger_thread_table; *ptr; ptr = &(*ptr)->next) {
- MonoDebuggerThreadInfo *info = *ptr;
-
- if (info->thread != thread)
- continue;
-
- if ((info->extended_notifications & (int) event) == 0)
- continue;
-
- mono_debugger_event (event, data, arg);
- }
-
- mono_debugger_unlock ();
-#endif
-}
-
-void
-mono_debugger_trampoline_compiled (const guint8 *trampoline, MonoMethod *method, const guint8 *code)
-{
-#ifdef MONO_DEBUGGER_SUPPORTED
- struct {
- const guint8 * trampoline;
- MonoMethod *method;
- const guint8 *code;
- } info = { trampoline, method, code };
-
- mono_debugger_extended_notification (MONO_DEBUGGER_EVENT_OLD_TRAMPOLINE,
- (guint64) (gsize) method, (guint64) (gsize) code);
- mono_debugger_extended_notification (MONO_DEBUGGER_EVENT_TRAMPOLINE,
- (guint64) (gsize) &info, 0);
-#endif
-}
-
#if MONO_DEBUGGER_SUPPORTED
static MonoDebuggerThreadInfo *
find_debugger_thread_info (MonoInternalThread *thread)
addr = compiled_method = mono_compile_method (m);
g_assert (addr);
- mono_debugger_trampoline_compiled (code, m, addr);
-
if (generic_virtual || variant_iface) {
if (vt->klass->valuetype) /*FIXME is this required variant iface?*/
need_unbox_tramp = TRUE;
addr = mono_compile_method (m);
g_assert (addr);
- mono_debugger_trampoline_compiled (NULL, m, addr);
-
return addr;
}
#endif
delegate->method_ptr = addr;
if (enable_caching && delegate->method_code)
*delegate->method_code = delegate->method_ptr;
- mono_debugger_trampoline_compiled (NULL, method, delegate->method_ptr);
}
} else {
if (need_rgctx_tramp)
code = mono_compile_method (m);
code = mini_add_method_trampoline (NULL, m, code, mono_method_needs_static_rgctx_invoke (m, FALSE), FALSE);
delegate->invoke_impl = mono_get_addr_from_ftnptr (code);
- mono_debugger_trampoline_compiled (NULL, m, delegate->invoke_impl);
return code;
}
MonoInternalThread *thread;
void *jit_tls = setup_jit_tls_data (stack_start, mono_thread_abort);
thread = mono_thread_internal_current ();
- mono_debugger_thread_created (tid, thread->root_domain_thread, jit_tls, func);
if (thread)
thread->jit_data = jit_tls;
MonoInternalThread *thread;
void *jit_tls = setup_jit_tls_data (stack_start, mono_thread_abort_dummy);
thread = mono_thread_internal_current ();
- mono_debugger_thread_created (tid, thread->root_domain_thread, (MonoJitTlsData *) jit_tls, NULL);
if (thread)
thread->jit_data = jit_tls;
if (mono_profiler_get_events () & MONO_PROFILE_STATISTICAL)
MonoJitTlsData *jit_tls = thread->jit_data;
if (jit_tls) {
- mono_debugger_thread_cleanup (jit_tls);
-
/* We can't clean up tls information if we are on another thread, it will clean up the wrong stuff
* It would be nice to issue a warning when this happens outside of the shutdown sequence. but it's
* not a trivial thing.