From 71a202fc01c3284608f486dd8ebb95bc57203221 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 19 Aug 2002 03:41:00 +0000 Subject: particular symbol for win32_exception_list. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2719 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++-- eval.c | 20 +++++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8072844853..a8167d8dcd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,10 @@ -Mon Aug 19 09:36:00 2002 Nobuyoshi Nakada +Mon Aug 19 12:38:33 2002 Nobuyoshi Nakada * eval.c (rb_thread_save_context, rb_thread_restore_context): save/restore SEH chain on MS-Windows at thread switch. [ruby-win32:273] - * eval.c (win32_get_exception_frame, win32_set_exception_frame): + * eval.c (win32_get_exception_list, win32_set_exception_list): added. Fri Aug 16 15:58:16 2002 WATANABE Hirofumi diff --git a/eval.c b/eval.c index b1e8aeeb2c..311bd5f097 100644 --- a/eval.c +++ b/eval.c @@ -7222,11 +7222,8 @@ Init_Proc() } /* Windows SEH refers data on the stack. */ +#undef SAVE_WIN32_EXCEPTION_LIST #if defined _WIN32 || defined __CYGWIN__ -# if !(defined _M_IX86 || defined __i386__) -# error unsupported processor -# endif - #if defined __CYGWIN__ typedef unsigned long DWORD; #endif @@ -7237,18 +7234,19 @@ win32_get_exception_list() DWORD p; # if defined _MSC_VER # ifdef _M_IX86 +# define SAVE_WIN32_EXCEPTION_LIST __asm mov eax, fs:[0]; __asm mov p, eax; # endif # elif defined __GNUC__ # ifdef __i386__ +# define SAVE_WIN32_EXCEPTION_LIST __asm__("movl %%fs:0,%0" : "=r"(p)); # endif # elif defined __BORLANDC__ +# define SAVE_WIN32_EXCEPTION_LIST __emit__(0x64, 0xA1, 0, 0, 0, 0); /* mov eax, fs:[0] */ p = _EAX; -# else -# error unsupported compiler # endif return p; } @@ -7271,6 +7269,10 @@ win32_set_exception_list(p) __emit__(0x64, 0xA3, 0, 0, 0, 0); /* mov fs:[0], eax */ # endif } + +#ifndef SAVE_WIN32_EXCEPTION_LIST +# error unsupported platform +#endif #endif static VALUE rb_eThreadError; @@ -7302,7 +7304,7 @@ enum thread_status { struct thread { struct thread *next, *prev; jmp_buf context; -#ifdef _WIN32 +#ifdef SAVE_WIN32_EXCEPTION_LIST DWORD win32_exception_list; #endif @@ -7556,7 +7558,7 @@ rb_thread_save_context(th) th->stk_len = len; FLUSH_REGISTER_WINDOWS; MEMCPY(th->stk_ptr, th->stk_pos, VALUE, th->stk_len); -#ifdef _WIN32 +#ifdef SAVE_WIN32_EXCEPTION_LIST th->win32_exception_list = win32_get_exception_list(); #endif @@ -7672,7 +7674,7 @@ rb_thread_restore_context(th, exit) ruby_current_node = th->node; -#ifdef _WIN32 +#ifdef SAVE_WIN32_EXCEPTION_LIST win32_set_exception_list(th->win32_exception_list); #endif tmp = th; -- cgit v1.2.3