From 5e0d760fb82d2d04c34306803253777aa5040fce Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Thu, 12 Oct 2000 06:22:30 +0000 Subject: * strace.cc (proc_child): Handle exceptions correctly. --- winsup/utils/strace.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'winsup/utils/strace.cc') diff --git a/winsup/utils/strace.cc b/winsup/utils/strace.cc index a958aa431..6f901e1a8 100644 --- a/winsup/utils/strace.cc +++ b/winsup/utils/strace.cc @@ -504,6 +504,7 @@ proc_child (unsigned mask, FILE *ofile) while (1) { BOOL debug_event = WaitForDebugEvent (&ev, 1000); + DWORD status = DBG_CONTINUE; if (!debug_event) continue; @@ -533,9 +534,12 @@ proc_child (unsigned mask, FILE *ofile) case EXIT_PROCESS_DEBUG_EVENT: remove_child (ev.dwProcessId); 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, - DBG_CONTINUE)) + if (!ContinueDebugEvent (ev.dwProcessId, ev.dwThreadId, status)) error (0, "couldn't continue debug event, windows error %d", GetLastError ()); if (ev.dwDebugEventCode == EXIT_PROCESS_DEBUG_EVENT && --processes == 0) -- cgit v1.2.3