未验证 提交 645dfe69 编写于 作者: T Thays Grazia 提交者: GitHub

Fix assertion on debugger-engine (#54041)

Sync to mono/mono #21100
上级 8698d0f3
......@@ -1609,13 +1609,14 @@ mono_debugger_free_objref (gpointer value)
// Returns true if TaskBuilder has NotifyDebuggerOfWaitCompletion method
// false if not(AsyncVoidBuilder)
MonoClass *
get_class_to_get_builder_field(DbgEngineStackFrame *frame)
get_class_to_get_builder_field (DbgEngineStackFrame *frame)
{
ERROR_DECL (error);
StackFrame *the_frame = (StackFrame *)frame;
gpointer this_addr = get_this_addr (frame);
MonoClass *original_class = frame->method->klass;
MonoClass *ret;
if (!m_class_is_valuetype (original_class) && mono_class_is_open_constructed_type (m_class_get_byval_arg (original_class))) {
if (mono_class_is_open_constructed_type (m_class_get_byval_arg (original_class))) {
MonoObject *this_obj = *(MonoObject**)this_addr;
MonoGenericContext context;
MonoType *inflated_type;
......@@ -1623,7 +1624,7 @@ get_class_to_get_builder_field(DbgEngineStackFrame *frame)
if (!this_obj)
return NULL;
context = mono_get_generic_context_from_stack_frame (frame->ji, this_obj->vtable);
context = mono_get_generic_context_from_stack_frame (frame->ji, mono_get_generic_info_from_stack_frame (frame->ji, &the_frame->ctx));
inflated_type = mono_class_inflate_generic_type_checked (m_class_get_byval_arg (original_class), &context, error);
mono_error_assert_ok (error); /* FIXME don't swallow the error */
......
......@@ -7909,7 +7909,7 @@ MONO_RESTORE_WARNING
/*
* Save the original location of 'this',
* get_generic_info_from_stack_frame () needs this to properly look up
* mono_get_generic_info_from_stack_frame () needs this to properly look up
* the argument value during the handling of async exceptions.
*/
if (i == 0 && sig->hasthis) {
......
......@@ -782,8 +782,8 @@ unwinder_unwind_frame (Unwinder *unwinder,
/*
* This function is async-safe.
*/
static gpointer
get_generic_info_from_stack_frame (MonoJitInfo *ji, MonoContext *ctx)
gpointer
mono_get_generic_info_from_stack_frame (MonoJitInfo *ji, MonoContext *ctx)
{
MonoGenericJitInfo *gi;
MonoMethod *method;
......@@ -1356,7 +1356,7 @@ mono_walk_stack_full (MonoJitStackWalk func, MonoContext *start_ctx, MonoJitTlsD
/* actual_method might already be set by mono_arch_unwind_frame () */
if (!frame.actual_method) {
if ((unwind_options & MONO_UNWIND_LOOKUP_ACTUAL_METHOD) && frame.ji)
frame.actual_method = get_method_from_stack_frame (frame.ji, get_generic_info_from_stack_frame (frame.ji, &ctx));
frame.actual_method = get_method_from_stack_frame (frame.ji, mono_get_generic_info_from_stack_frame (frame.ji, &ctx));
else
frame.actual_method = frame.method;
}
......@@ -1895,7 +1895,7 @@ ves_icall_get_frame_info (gint32 skip, MonoBoolean need_file_info,
jmethod = frame.method;
actual_method = frame.actual_method;
} else {
actual_method = get_method_from_stack_frame (ji, get_generic_info_from_stack_frame (ji, &ctx));
actual_method = get_method_from_stack_frame (ji, mono_get_generic_info_from_stack_frame (ji, &ctx));
}
}
......@@ -1951,7 +1951,7 @@ get_exception_catch_class (MonoJitExceptionInfo *ei, MonoJitInfo *ji, MonoContex
if (!ji->has_generic_jit_info || !mono_jit_info_get_generic_jit_info (ji)->has_this)
return catch_class;
context = mono_get_generic_context_from_stack_frame (ji, get_generic_info_from_stack_frame (ji, ctx));
context = mono_get_generic_context_from_stack_frame (ji, mono_get_generic_info_from_stack_frame (ji, ctx));
/* FIXME: we shouldn't inflate but instead put the
type in the rgctx and fetch it from there. It
......@@ -2315,7 +2315,7 @@ handle_exception_first_pass (MonoContext *ctx, MonoObject *obj, gint32 *out_filt
// avoid giant stack traces during a stack overflow
if (frame_count < 1000) {
trace_ips = g_list_prepend (trace_ips, ip);
trace_ips = g_list_prepend (trace_ips, get_generic_info_from_stack_frame (ji, ctx));
trace_ips = g_list_prepend (trace_ips, mono_get_generic_info_from_stack_frame (ji, ctx));
trace_ips = g_list_prepend (trace_ips, ji);
}
}
......
......@@ -2935,6 +2935,9 @@ mono_arch_load_function (MonoJitICallId jit_icall_id);
MonoGenericContext
mono_get_generic_context_from_stack_frame (MonoJitInfo *ji, gpointer generic_info);
gpointer
mono_get_generic_info_from_stack_frame (MonoJitInfo *ji, MonoContext *ctx);
MonoMemoryManager* mini_get_default_mem_manager (void);
#endif /* __MONO_MINI_H__ */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册