Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
bingbingbingbing
mono
提交
4c3c63f3
M
mono
项目概览
bingbingbingbing
/
mono
与 Fork 源项目一致
从无法访问的项目Fork
通知
35
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mono
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
4c3c63f3
编写于
3月 08, 2011
作者:
L
Lucas Meijer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
backport of
ee5a8cf9
, still under the mit x11 license.
上级
b428261e
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
45 addition
and
12 deletion
+45
-12
mono/mini/exceptions-amd64.c
mono/mini/exceptions-amd64.c
+10
-4
mono/mini/exceptions-x86.c
mono/mini/exceptions-x86.c
+10
-4
mono/mini/mini-windows.c
mono/mini/mini-windows.c
+19
-0
mono/mini/mini-x86.c
mono/mini/mini-x86.c
+3
-2
mono/mini/mini-x86.h
mono/mini/mini-x86.h
+2
-1
mono/mini/mini.h
mono/mini/mini.h
+1
-1
未找到文件。
mono/mini/exceptions-amd64.c
浏览文件 @
4c3c63f3
...
...
@@ -38,10 +38,12 @@ static MonoW32ExceptionHandler fpe_handler;
static
MonoW32ExceptionHandler
ill_handler
;
static
MonoW32ExceptionHandler
segv_handler
;
static
LPTOP_LEVEL_EXCEPTION_FILTER
old_handler
;
LPTOP_LEVEL_EXCEPTION_FILTER
mono_old_win_toplevel_exception_filter
;
guint64
mono_win_chained_exception_filter_result
;
gboolean
mono_win_chained_exception_filter_didrun
;
#define W32_SEH_HANDLE_EX(_ex) \
if (_ex##_handler) _ex##_handler(0, e
r
, sctx)
if (_ex##_handler) _ex##_handler(0, e
p
, sctx)
/*
* Unhandled Exception Filter
...
...
@@ -54,6 +56,7 @@ LONG CALLBACK seh_handler(EXCEPTION_POINTERS* ep)
MonoContext
*
sctx
;
LONG
res
;
mono_win_chained_exception_filter_didrun
=
FALSE
;
res
=
EXCEPTION_CONTINUE_EXECUTION
;
er
=
ep
->
ExceptionRecord
;
...
...
@@ -114,17 +117,20 @@ LONG CALLBACK seh_handler(EXCEPTION_POINTERS* ep)
g_free
(
sctx
);
if
(
mono_win_chained_exception_filter_didrun
)
res
=
mono_win_chained_exception_filter_result
;
return
res
;
}
void
win32_seh_init
()
{
old_handl
er
=
SetUnhandledExceptionFilter
(
seh_handler
);
mono_old_win_toplevel_exception_filt
er
=
SetUnhandledExceptionFilter
(
seh_handler
);
}
void
win32_seh_cleanup
()
{
if
(
old_handler
)
SetUnhandledExceptionFilter
(
old_handl
er
);
if
(
mono_old_win_toplevel_exception_filter
)
SetUnhandledExceptionFilter
(
mono_old_win_toplevel_exception_filt
er
);
}
void
win32_seh_set_handler
(
int
type
,
MonoW32ExceptionHandler
handler
)
...
...
mono/mini/exceptions-x86.c
浏览文件 @
4c3c63f3
...
...
@@ -39,14 +39,16 @@ static MonoW32ExceptionHandler fpe_handler;
static
MonoW32ExceptionHandler
ill_handler
;
static
MonoW32ExceptionHandler
segv_handler
;
static
LPTOP_LEVEL_EXCEPTION_FILTER
old_handler
;
LPTOP_LEVEL_EXCEPTION_FILTER
mono_old_win_toplevel_exception_filter
;
guint64
mono_win_chained_exception_filter_result
;
gboolean
mono_win_chained_exception_filter_didrun
;
#ifndef PROCESS_CALLBACK_FILTER_ENABLED
# define PROCESS_CALLBACK_FILTER_ENABLED 1
#endif
#define W32_SEH_HANDLE_EX(_ex) \
if (_ex##_handler) _ex##_handler(0, e
r
, sctx)
if (_ex##_handler) _ex##_handler(0, e
p
, sctx)
/*
* mono_win32_get_handle_stackoverflow (void):
...
...
@@ -176,6 +178,7 @@ LONG CALLBACK seh_handler(EXCEPTION_POINTERS* ep)
struct
sigcontext
*
sctx
;
LONG
res
;
mono_win_chained_exception_filter_didrun
=
FALSE
;
res
=
EXCEPTION_CONTINUE_EXECUTION
;
er
=
ep
->
ExceptionRecord
;
...
...
@@ -228,6 +231,9 @@ LONG CALLBACK seh_handler(EXCEPTION_POINTERS* ep)
g_free
(
sctx
);
if
(
mono_win_chained_exception_filter_didrun
)
res
=
mono_win_chained_exception_filter_result
;
return
res
;
}
...
...
@@ -237,12 +243,12 @@ void win32_seh_init()
if
(
!
restore_stack
)
restore_stack
=
mono_win32_get_handle_stackoverflow
();
old_handl
er
=
SetUnhandledExceptionFilter
(
seh_handler
);
mono_old_win_toplevel_exception_filt
er
=
SetUnhandledExceptionFilter
(
seh_handler
);
}
void
win32_seh_cleanup
()
{
if
(
old_handler
)
SetUnhandledExceptionFilter
(
old_handl
er
);
if
(
mono_old_win_toplevel_exception_filter
)
SetUnhandledExceptionFilter
(
mono_old_win_toplevel_exception_filt
er
);
}
void
win32_seh_set_handler
(
int
type
,
MonoW32ExceptionHandler
handler
)
...
...
mono/mini/mini-windows.c
浏览文件 @
4c3c63f3
...
...
@@ -50,6 +50,10 @@
#include "jit-icalls.h"
extern
LPTOP_LEVEL_EXCEPTION_FILTER
mono_old_win_toplevel_exception_filter
;
extern
guint64
mono_win_chained_exception_filter_result
;
extern
gboolean
mono_win_chained_exception_filter_didrun
;
void
mono_runtime_install_handlers
(
void
)
{
...
...
@@ -71,9 +75,24 @@ mono_runtime_cleanup_handlers (void)
#endif
}
/* mono_chain_signal:
*
* Call the original signal handler for the signal given by the arguments, which
* should be the same as for a signal handler. Returns TRUE if the original handler
* was called, false otherwise.
*/
gboolean
SIG_HANDLER_SIGNATURE
(
mono_chain_signal
)
{
int
signal
=
_dummy
;
GET_CONTEXT
;
if
(
mono_old_win_toplevel_exception_filter
)
{
mono_win_chained_exception_filter_didrun
=
TRUE
;
mono_win_chained_exception_filter_result
=
(
*
mono_old_win_toplevel_exception_filter
)(
info
);
return
TRUE
;
}
return
FALSE
;
}
...
...
mono/mini/mini-x86.c
浏览文件 @
4c3c63f3
...
...
@@ -6444,7 +6444,8 @@ gboolean
mono_arch_is_single_step_event
(
void
*
info
,
void
*
sigctx
)
{
#ifdef TARGET_WIN32
EXCEPTION_RECORD
*
einfo
=
(
EXCEPTION_RECORD
*
)
info
;
/* Sometimes the address is off by 4 */
EXCEPTION_RECORD
*
einfo
=
((
EXCEPTION_POINTERS
*
)
info
)
->
ExceptionRecord
;
/* Sometimes the address is off by 4 */
if
((
einfo
->
ExceptionInformation
[
1
]
>=
ss_trigger_page
&&
(
guint8
*
)
einfo
->
ExceptionInformation
[
1
]
<=
(
guint8
*
)
ss_trigger_page
+
128
))
return
TRUE
;
else
...
...
@@ -6463,7 +6464,7 @@ gboolean
mono_arch_is_breakpoint_event
(
void
*
info
,
void
*
sigctx
)
{
#ifdef TARGET_WIN32
EXCEPTION_RECORD
*
einfo
=
(
EXCEPTION_RECORD
*
)
info
;
/* Sometimes the address is off by 4 */
EXCEPTION_RECORD
*
einfo
=
(
(
EXCEPTION_POINTERS
*
)
info
)
->
ExceptionRecord
;
/* Sometimes the address is off by 4 */
if
((
einfo
->
ExceptionInformation
[
1
]
>=
bp_trigger_page
&&
(
guint8
*
)
einfo
->
ExceptionInformation
[
1
]
<=
(
guint8
*
)
bp_trigger_page
+
128
))
return
TRUE
;
else
...
...
mono/mini/mini-x86.h
浏览文件 @
4c3c63f3
...
...
@@ -31,7 +31,8 @@ struct sigcontext {
unsigned
int
eip
;
};
typedef
void
(
*
MonoW32ExceptionHandler
)
(
int
_dummy
,
EXCEPTION_RECORD
*
info
,
void
*
context
);
typedef
void
(
*
MonoW32ExceptionHandler
)
(
int
_dummy
,
EXCEPTION_POINTERS
*
info
,
void
*
context
);
void
win32_seh_init
(
void
);
void
win32_seh_cleanup
(
void
);
void
win32_seh_set_handler
(
int
type
,
MonoW32ExceptionHandler
handler
);
...
...
mono/mini/mini.h
浏览文件 @
4c3c63f3
...
...
@@ -2421,7 +2421,7 @@ gboolean mono_gdb_render_native_backtraces (void) MONO_INTERNAL;
#define SIG_HANDLER_SIGNATURE(ftn) ftn (int _dummy, siginfo_t *info, void *context)
#define SIG_HANDLER_PARAMS _dummy, info, context
#elif defined(HOST_WIN32)
#define SIG_HANDLER_SIGNATURE(ftn) ftn (int _dummy, EXCEPTION_
RECORD
*info, void *context)
#define SIG_HANDLER_SIGNATURE(ftn) ftn (int _dummy, EXCEPTION_
POINTERS
*info, void *context)
#define SIG_HANDLER_PARAMS _dummy, info, context
#elif defined(__HAIKU__)
#define SIG_HANDLER_SIGNATURE(ftn) ftn (int _dummy, void *userData, vregs regs)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录