and to finish the implementation of the ctrl-c handling in winedbg we need to stop actually the debugger when the exception generated by DebugBreakProcess() is received A+
Name: wdbg_break ChangeLog: really enter the debugger when DebugBreak(Process) is invoked on debuggee License: X11 GenDate: 2002/06/01 19:23:24 UTC ModifiedFiles: debugger/break.c AddedFiles: =================================================================== RCS file: /home/cvs/cvsroot/wine/wine/debugger/break.c,v retrieving revision 1.32 diff -u -u -r1.32 break.c --- debugger/break.c 31 May 2002 23:06:46 -0000 1.32 +++ debugger/break.c 1 Jun 2002 08:52:24 -0000 @@ -799,7 +799,7 @@ syminfo = DEBUG_PrintAddress( addr, addr_mode, TRUE ); DEBUG_Printf(DBG_CHN_MESG, " values: old=%lu new=%lu\n", - oldval, breakpoints[wpnum].u.w.oldval); + oldval, breakpoints[wpnum].u.w.oldval); if (syminfo.list.sourcefile != NULL) DEBUG_List(&syminfo.list, NULL, 0); return FALSE; @@ -844,12 +844,20 @@ } #ifdef __i386__ - /* If there's no breakpoint and we are not single-stepping, then we */ - /* must have encountered an int3 in the Windows program; let's skip it. */ + /* If there's no breakpoint and we are not single-stepping, then + * either we must have encountered an int3 in the Windows program + * or someone is trying to stop us + * If the later, (no int3 opcode at current address) then stop, + * otherwise, let's skip it. + */ if ((bpnum == -1) && code == EXCEPTION_BREAKPOINT) { + unsigned char c; + + if (!DEBUG_READ_MEM(&addr, &c, 1)) c = 0xCC; DEBUG_context.Eip++; addr->off++; + if (c != 0xCC) return FALSE; } #endif