* strace.cc (proc_child): Handle exceptions correctly.

This commit is contained in:
Christopher Faylor 2000-10-12 06:22:30 +00:00
parent ec300c9979
commit 5e0d760fb8
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,7 @@
Thu Oct 12 02:19:12 2000 Christopher Faylor <cgf@cygnus.com>
* strace.cc (proc_child): Handle exceptions correctly.
Sun Oct 8 23:11:17 2000 Christopher Faylor <cgf@cygnus.com> Sun Oct 8 23:11:17 2000 Christopher Faylor <cgf@cygnus.com>
* ps.cc (main): Change order of reporting slightly so that windows pids * ps.cc (main): Change order of reporting slightly so that windows pids

View File

@ -504,6 +504,7 @@ proc_child (unsigned mask, FILE *ofile)
while (1) while (1)
{ {
BOOL debug_event = WaitForDebugEvent (&ev, 1000); BOOL debug_event = WaitForDebugEvent (&ev, 1000);
DWORD status = DBG_CONTINUE;
if (!debug_event) if (!debug_event)
continue; continue;
@ -533,9 +534,12 @@ proc_child (unsigned mask, FILE *ofile)
case EXIT_PROCESS_DEBUG_EVENT: case EXIT_PROCESS_DEBUG_EVENT:
remove_child (ev.dwProcessId); remove_child (ev.dwProcessId);
break; break;
case EXCEPTION_DEBUG_EVENT:
if (ev.u.Exception.ExceptionRecord.ExceptionCode != STATUS_BREAKPOINT)
status = DBG_EXCEPTION_NOT_HANDLED;
break;
} }
if (!ContinueDebugEvent (ev.dwProcessId, ev.dwThreadId, if (!ContinueDebugEvent (ev.dwProcessId, ev.dwThreadId, status))
DBG_CONTINUE))
error (0, "couldn't continue debug event, windows error %d", error (0, "couldn't continue debug event, windows error %d",
GetLastError ()); GetLastError ());
if (ev.dwDebugEventCode == EXIT_PROCESS_DEBUG_EVENT && --processes == 0) if (ev.dwDebugEventCode == EXIT_PROCESS_DEBUG_EVENT && --processes == 0)