Vitaliy Margolen schrieb:
ChangeLog: ntdll: Program could modify Dr* registers in segv_handler too.
Doesn't every exception handler could modify these registers? So probably it would be better to put this check into RtlRaiseException?
Sunday, December 11, 2005, 9:07:06 AM, Peter Beutner wrote:
Vitaliy Margolen schrieb:
ChangeLog: ntdll: Program could modify Dr* registers in segv_handler too.
Doesn't every exception handler could modify these registers? So probably it would be better to put this check into RtlRaiseException?
Nope can't. __regs_RtlRaiseException is common for all the platforms (implemented in dlls/ntdll/exception.c). While Dr* registers are not available on all the platforms.
Vitaliy
Vitaliy Margolen schrieb:
Sunday, December 11, 2005, 9:07:06 AM, Peter Beutner wrote:
Vitaliy Margolen schrieb:
ChangeLog: ntdll: Program could modify Dr* registers in segv_handler too.
Doesn't every exception handler could modify these registers? So probably it would be better to put this check into RtlRaiseException?
Nope can't. __regs_RtlRaiseException is common for all the platforms (implemented in dlls/ntdll/exception.c). While Dr* registers are not available on all the platforms.
What about putting some #ifdef __i386__ ... #endif around it?
Sunday, December 11, 2005, 10:36:39 AM, Peter Beutner wrote:
Vitaliy Margolen schrieb:
Sunday, December 11, 2005, 9:07:06 AM, Peter Beutner wrote:
Vitaliy Margolen schrieb:
ChangeLog: ntdll: Program could modify Dr* registers in segv_handler too.
Doesn't every exception handler could modify these registers? So probably it would be better to put this check into RtlRaiseException?
Nope can't. __regs_RtlRaiseException is common for all the platforms (implemented in dlls/ntdll/exception.c). While Dr* registers are not available on all the platforms.
What about putting some #ifdef __i386__ ... #endif around it?
That's what signal_*.c are for...
Vitaliy Margolen schrieb:
Sunday, December 11, 2005, 10:36:39 AM, Peter Beutner wrote:
Vitaliy Margolen schrieb:
Sunday, December 11, 2005, 9:07:06 AM, Peter Beutner wrote:
Vitaliy Margolen schrieb:
ChangeLog: ntdll: Program could modify Dr* registers in segv_handler too.
Doesn't every exception handler could modify these registers? So probably it would be better to put this check into RtlRaiseException?
Nope can't. __regs_RtlRaiseException is common for all the platforms (implemented in dlls/ntdll/exception.c). While Dr* registers are not available on all the platforms.
What about putting some #ifdef __i386__ ... #endif around it?
That's what signal_*.c are for...
The name suggests it's more about signal handling than a place to throw every arch dependent code in it ;) But that's not the point. I just thought it might not be the best solution to duplicate that check in every signal handler. Besides what about somebody changes the Dr* registers in an exception handler invoked by an exception raised by the application via RaiseException(i.e. not via a signal handler called by the kernel)? *Every* installed exception handler can change the registers in the CONTEXT structure, thats why I think it would be the easiest way to implement it in __regs_RtlRaiseException.
Sunday, December 11, 2005, 11:23:18 AM, Peter Beutner wrote:
Vitaliy Margolen schrieb:
Sunday, December 11, 2005, 10:36:39 AM, Peter Beutner wrote:
Vitaliy Margolen schrieb:
Sunday, December 11, 2005, 9:07:06 AM, Peter Beutner wrote:
Vitaliy Margolen schrieb:
ChangeLog: ntdll: Program could modify Dr* registers in segv_handler too.
Doesn't every exception handler could modify these registers? So probably it would be better to put this check into RtlRaiseException?
Nope can't. __regs_RtlRaiseException is common for all the platforms (implemented in dlls/ntdll/exception.c). While Dr* registers are not available on all the platforms.
What about putting some #ifdef __i386__ ... #endif around it?
That's what signal_*.c are for...
The name suggests it's more about signal handling than a place to throw every arch dependent code in it ;) But that's not the point. I just thought it might not be the best solution to duplicate that check in every signal handler. Besides what about somebody changes the Dr* registers in an exception handler invoked by an exception raised by the application via RaiseException(i.e. not via a signal handler called by the kernel)? *Every* installed exception handler can change the registers in the CONTEXT structure, thats why I think it would be the easiest way to implement it in __regs_RtlRaiseException.
Good point but it needs a test. Besides I'm not sure that we will change any registers in that case at all. (just checked and no, we won't change any registers).
Vitaliy Margolen schrieb:
Sunday, December 11, 2005, 11:23:18 AM, Peter Beutner wrote:
The name suggests it's more about signal handling than a place to throw every arch dependent code in it ;) But that's not the point. I just thought it might not be the best solution to duplicate that check in every signal handler. Besides what about somebody changes the Dr* registers in an exception handler invoked by an exception raised by the application via RaiseException(i.e. not via a signal handler called by the kernel)? *Every* installed exception handler can change the registers in the CONTEXT structure, thats why I think it would be the easiest way to implement it in __regs_RtlRaiseException.
Good point but it needs a test. Besides I'm not sure that we will change any registers in that case at all. (just checked and no, we won't change any registers).
hm what exactly do you need to test?
And afaik the registers will be changed when the CONTEXT structure is restored on return from __regs_RtlRaiseException. see __wine_call_from_32_regs.