guint32 stopped_on_unhandled : 1;
} MonoDebuggerExceptionState;
+typedef enum {
+ MONO_DEBUGGER_THREAD_FLAGS_NONE = 0,
+ MONO_DEBUGGER_THREAD_FLAGS_INTERNAL = 1,
+ MONO_DEBUGGER_THREAD_FLAGS_THREADPOOL = 2
+} MonoDebuggerThreadFlags;
+
struct _MonoDebuggerThreadInfo {
guint64 tid;
guint64 lmf_addr;
guint32 stack_size;
guint32 signal_stack_size;
- MonoDebuggerExceptionState exception_state;
+ guint32 thread_flags;
/*
* The debugger doesn't access anything beyond this point.
*/
+ MonoDebuggerExceptionState exception_state;
+
MonoJitTlsData *jit_tls;
MonoThread *thread;
};
for (i = 0; i < jit->num_line_numbers; i++)
jit->line_numbers [i] = g_array_index (info->line_numbers, MonoDebugLineNumberEntry, i);
- debug_info = mono_debug_add_method (method, jit, cfg->domain);
+ debug_info = mono_debug_add_method (cfg->method_to_register, jit, cfg->domain);
mono_debug_add_vg_method (method, jit);
- if (info->breakpoint_id)
- mono_debugger_breakpoint_callback (method, info->breakpoint_id);
-
mono_debugger_check_breakpoints (method, debug_info);
mono_debug_free_method_jit_info (jit);
{
int i;
- if (!breakpoints || (method->wrapper_type != MONO_WRAPPER_NONE))
+ if (!breakpoints || ((method->wrapper_type != MONO_WRAPPER_NONE) &&
+ (method->wrapper_type != MONO_WRAPPER_DYNAMIC_METHOD)))
return 0;
for (i = 0; i < breakpoints->len; i++) {
}
void
-mono_debugger_thread_created (gsize tid, MonoThread *thread, MonoJitTlsData *jit_tls)
+mono_debugger_thread_created (gsize tid, MonoThread *thread, MonoJitTlsData *jit_tls, gpointer func)
{
#ifdef MONO_DEBUGGER_SUPPORTED
size_t stsize = 0;
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;
}
void
-mono_debugger_trampoline_compiled (MonoMethod *method, const guint8 *code)
+mono_debugger_trampoline_compiled (const guint8 *trampoline, MonoMethod *method, const guint8 *code)
{
- mono_debugger_extended_notification (MONO_DEBUGGER_EVENT_TRAMPOLINE,
+#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
#endif
MonoDebuggerExceptionAction
-mono_debugger_throw_exception (gpointer addr, gpointer stack, MonoObject *exc)
+_mono_debugger_throw_exception (gpointer addr, gpointer stack, MonoObject *exc)
{
#ifdef MONO_DEBUGGER_SUPPORTED
MonoDebuggerExceptionInfo exc_info;
}
gboolean
-mono_debugger_unhandled_exception (gpointer addr, gpointer stack, MonoObject *exc)
+_mono_debugger_unhandled_exception (gpointer addr, gpointer stack, MonoObject *exc)
{
#ifdef MONO_DEBUGGER_SUPPORTED
MonoDebuggerThreadInfo *thread_info;
#endif
}
+/*
+ * mono_debugger_call_exception_handler:
+ *
+ * Called from mono_handle_exception_internal() to tell the debugger that we're about
+ * to invoke an exception handler.
+ *
+ * The debugger may choose to set a breakpoint at @addr. This is used if the user is
+ * single-stepping from a `try' into a `catch' block, for instance.
+ */
+
void
-mono_debugger_handle_exception (gpointer addr, gpointer stack, MonoObject *exc)
+mono_debugger_call_exception_handler (gpointer addr, gpointer stack, MonoObject *exc)
{
#ifdef MONO_DEBUGGER_SUPPORTED
MonoDebuggerThreadInfo *thread_info;