Commit 7d12fbcc authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Changed some Solaris defines so that we can access the signal error code.

parent 6a514819
...@@ -59,11 +59,15 @@ ...@@ -59,11 +59,15 @@
#include "thread.h" #include "thread.h"
#include "wine/library.h" #include "wine/library.h"
#include "ntdll_misc.h" #include "ntdll_misc.h"
#include "wine/exception.h"
#include "wine/debug.h"
#ifdef HAVE_VALGRIND_MEMCHECK_H #ifdef HAVE_VALGRIND_MEMCHECK_H
#include <valgrind/memcheck.h> #include <valgrind/memcheck.h>
#endif #endif
#undef ERR /* Solaris needs to define this */
/*********************************************************************** /***********************************************************************
* signal context platform-specific definitions * signal context platform-specific definitions
*/ */
...@@ -196,10 +200,7 @@ typedef struct sigcontext SIGCONTEXT; ...@@ -196,10 +200,7 @@ typedef struct sigcontext SIGCONTEXT;
#ifdef _SCO_DS #ifdef _SCO_DS
#include <sys/regset.h> #include <sys/regset.h>
#endif #endif
/* Solaris kludge */
#undef ERR
#include <sys/ucontext.h> #include <sys/ucontext.h>
#undef ERR
typedef struct ucontext SIGCONTEXT; typedef struct ucontext SIGCONTEXT;
#ifdef _SCO_DS #ifdef _SCO_DS
...@@ -232,6 +233,9 @@ typedef struct ucontext SIGCONTEXT; ...@@ -232,6 +233,9 @@ typedef struct ucontext SIGCONTEXT;
#else #else
#define ESP_sig(context) ((context)->uc_mcontext.gregs[ESP]) #define ESP_sig(context) ((context)->uc_mcontext.gregs[ESP])
#endif #endif
#ifdef ERR
#define ERROR_sig(context) ((context)->uc_mcontext.gregs[ERR])
#endif
#ifdef TRAPNO #ifdef TRAPNO
#define TRAP_sig(context) ((context)->uc_mcontext.gregs[TRAPNO]) #define TRAP_sig(context) ((context)->uc_mcontext.gregs[TRAPNO])
#endif #endif
...@@ -286,9 +290,6 @@ typedef ucontext_t SIGCONTEXT; ...@@ -286,9 +290,6 @@ typedef ucontext_t SIGCONTEXT;
#endif /* __APPLE__ */ #endif /* __APPLE__ */
#include "wine/exception.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(seh); WINE_DEFAULT_DEBUG_CHANNEL(seh);
typedef int (*wine_signal_handler)(unsigned int sig); typedef int (*wine_signal_handler)(unsigned int sig);
...@@ -899,7 +900,7 @@ static EXCEPTION_RECORD *setup_exception( SIGCONTEXT *sigcontext, raise_func fun ...@@ -899,7 +900,7 @@ static EXCEPTION_RECORD *setup_exception( SIGCONTEXT *sigcontext, raise_func fun
if ((char *)stack >= (char *)get_signal_stack() && if ((char *)stack >= (char *)get_signal_stack() &&
(char *)stack < (char *)get_signal_stack() + signal_stack_size) (char *)stack < (char *)get_signal_stack() + signal_stack_size)
{ {
ERR( "nested exception on signal stack in thread %04x eip %08x esp %08x stack %p-%p\n", WINE_ERR( "nested exception on signal stack in thread %04x eip %08x esp %08x stack %p-%p\n",
GetCurrentThreadId(), (unsigned int) EIP_sig(sigcontext), GetCurrentThreadId(), (unsigned int) EIP_sig(sigcontext),
(unsigned int) ESP_sig(sigcontext), NtCurrentTeb()->Tib.StackLimit, (unsigned int) ESP_sig(sigcontext), NtCurrentTeb()->Tib.StackLimit,
NtCurrentTeb()->Tib.StackBase ); NtCurrentTeb()->Tib.StackBase );
...@@ -913,7 +914,7 @@ static EXCEPTION_RECORD *setup_exception( SIGCONTEXT *sigcontext, raise_func fun ...@@ -913,7 +914,7 @@ static EXCEPTION_RECORD *setup_exception( SIGCONTEXT *sigcontext, raise_func fun
UINT diff = (char *)NtCurrentTeb()->Tib.StackLimit - (char *)stack; UINT diff = (char *)NtCurrentTeb()->Tib.StackLimit - (char *)stack;
if (diff < 4096) if (diff < 4096)
{ {
ERR( "stack overflow %u bytes in thread %04x eip %08x esp %08x stack %p-%p\n", WINE_ERR( "stack overflow %u bytes in thread %04x eip %08x esp %08x stack %p-%p\n",
diff, GetCurrentThreadId(), (unsigned int) EIP_sig(sigcontext), diff, GetCurrentThreadId(), (unsigned int) EIP_sig(sigcontext),
(unsigned int) ESP_sig(sigcontext), NtCurrentTeb()->Tib.StackLimit, (unsigned int) ESP_sig(sigcontext), NtCurrentTeb()->Tib.StackLimit,
NtCurrentTeb()->Tib.StackBase ); NtCurrentTeb()->Tib.StackBase );
...@@ -1165,7 +1166,7 @@ static void segv_handler( int signal, siginfo_t *siginfo, void *sigcontext ) ...@@ -1165,7 +1166,7 @@ static void segv_handler( int signal, siginfo_t *siginfo, void *sigcontext )
rec->ExceptionCode = EXCEPTION_DATATYPE_MISALIGNMENT; rec->ExceptionCode = EXCEPTION_DATATYPE_MISALIGNMENT;
break; break;
default: default:
ERR( "Got unexpected trap %d\n", get_trap_code(context) ); WINE_ERR( "Got unexpected trap %d\n", get_trap_code(context) );
/* fall through */ /* fall through */
case TRAP_x86_NMI: /* NMI interrupt */ case TRAP_x86_NMI: /* NMI interrupt */
case TRAP_x86_DNA: /* Device not available exception */ case TRAP_x86_DNA: /* Device not available exception */
...@@ -1243,7 +1244,7 @@ static void fpe_handler( int signal, siginfo_t *siginfo, void *sigcontext ) ...@@ -1243,7 +1244,7 @@ static void fpe_handler( int signal, siginfo_t *siginfo, void *sigcontext )
rec->ExceptionInformation[0] = 0; rec->ExceptionInformation[0] = 0;
break; break;
default: default:
ERR( "Got unexpected trap %d\n", get_trap_code(context) ); WINE_ERR( "Got unexpected trap %d\n", get_trap_code(context) );
rec->ExceptionCode = EXCEPTION_FLT_INVALID_OPERATION; rec->ExceptionCode = EXCEPTION_FLT_INVALID_OPERATION;
break; break;
} }
...@@ -1485,7 +1486,7 @@ void __wine_enter_vm86( CONTEXT *context ) ...@@ -1485,7 +1486,7 @@ void __wine_enter_vm86( CONTEXT *context )
break; break;
case VM86_SIGNAL: /* cannot happen because vm86_enter handles this case */ case VM86_SIGNAL: /* cannot happen because vm86_enter handles this case */
default: default:
ERR( "unhandled result from vm86 mode %x\n", res ); WINE_ERR( "unhandled result from vm86 mode %x\n", res );
continue; continue;
} }
__regs_RtlRaiseException( &rec, context ); __regs_RtlRaiseException( &rec, context );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment