Add a #ifdef to deal with NetBSD specific debug register structure. Debug register structure on NetBSD for x86 (/usr/include/<arch>/reg.h) is: struct dbreg { int dr[<nb>]; } with nb=8 on i386 and nb=16 on amd64.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46229 Signed-off-by: Frédéric Fauberteau triaxx@NetBSD.org --- server/ptrace.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
diff --git a/server/ptrace.c b/server/ptrace.c index 4eda8ebec3..808328ecbc 100644 --- a/server/ptrace.c +++ b/server/ptrace.c @@ -720,6 +720,13 @@ void get_thread_context( struct thread *thread, context_t *context, unsigned int context->debug.i386_regs.dr3 = DBREG_DRX((&dbregs), 3); context->debug.i386_regs.dr6 = DBREG_DRX((&dbregs), 6); context->debug.i386_regs.dr7 = DBREG_DRX((&dbregs), 7); +#elif defined(__NetBSD__) + context->debug.i386_regs.dr0 = dbregs.dr[0]; + context->debug.i386_regs.dr1 = dbregs.dr[1]; + context->debug.i386_regs.dr2 = dbregs.dr[2]; + context->debug.i386_regs.dr3 = dbregs.dr[3]; + context->debug.i386_regs.dr6 = dbregs.dr[6]; + context->debug.i386_regs.dr7 = dbregs.dr[7]; #else context->debug.i386_regs.dr0 = dbregs.dr0; context->debug.i386_regs.dr1 = dbregs.dr1; @@ -754,6 +761,15 @@ void set_thread_context( struct thread *thread, const context_t *context, unsign DBREG_DRX((&dbregs), 5) = 0; DBREG_DRX((&dbregs), 6) = context->debug.i386_regs.dr6; DBREG_DRX((&dbregs), 7) = context->debug.i386_regs.dr7; +#elif defined(__NetBSD__) + dbregs.dr[0] = context->debug.i386_regs.dr0; + dbregs.dr[1] = context->debug.i386_regs.dr1; + dbregs.dr[2] = context->debug.i386_regs.dr2; + dbregs.dr[3] = context->debug.i386_regs.dr3; + dbregs.dr[4] = 0; + dbregs.dr[5] = 0; + dbregs.dr[6] = context->debug.i386_regs.dr6; + dbregs.dr[7] = context->debug.i386_regs.dr7; #else dbregs.dr0 = context->debug.i386_regs.dr0; dbregs.dr1 = context->debug.i386_regs.dr1;
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=45414
Your paranoid android.
=== debian9 (build log) ===
error: corrupt patch at line 20 Task: Patch failed to apply
=== debian9 (build log) ===
error: corrupt patch at line 20 Task: Patch failed to apply