From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2201) id 701F23844030; Fri, 31 Jul 2020 13:01:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 701F23844030 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Jon TURNEY To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: Speed up dumper X-Act-Checkin: newlib-cygwin X-Git-Author: Jon Turney X-Git-Refname: refs/heads/master X-Git-Oldrev: 0d4d2d38fbdf923f379a89b82b6a63580abbaed2 X-Git-Newrev: c222c1b294c7d6e2b0e554aa2fbde79c8b768594 Message-Id: <20200731130141.701F23844030@sourceware.org> Date: Fri, 31 Jul 2020 13:01:41 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Jul 2020 13:01:41 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=c222c1b294c7d6e2b0e554aa2fbde79c8b768594 commit c222c1b294c7d6e2b0e554aa2fbde79c8b768594 Author: Jon Turney Date: Mon Jul 6 15:10:40 2020 +0100 Cygwin: Speed up dumper Stop after we've written the dump in response to the initial breakpoint EXCEPTION_DEBUG_EVENT we recieve for attaching to the process. (rather than bogusly sitting there for 20 seconds waiting for more debug events from a stopped process after we've already written the dump). Diff: --- winsup/utils/dumper.cc | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/winsup/utils/dumper.cc b/winsup/utils/dumper.cc index 816320e6d..5f8121aa3 100644 --- a/winsup/utils/dumper.cc +++ b/winsup/utils/dumper.cc @@ -615,8 +615,6 @@ out: int dumper::collect_process_information () { - int exception_level = 0; - if (!sane ()) return 0; @@ -631,7 +629,7 @@ dumper::collect_process_information () while (1) { - if (!WaitForDebugEvent (¤t_event, 20000)) + if (!WaitForDebugEvent (¤t_event, INFINITE)) return 0; deb_printf ("got debug event %d\n", current_event.dwDebugEventCode); @@ -675,12 +673,6 @@ dumper::collect_process_information () case EXCEPTION_DEBUG_EVENT: - exception_level++; - if (exception_level == 2) - break; - else if (exception_level > 2) - return 0; - collect_memory_sections (); /* got all info. time to dump */ @@ -697,6 +689,9 @@ dumper::collect_process_information () goto failed; }; + /* We're done */ + goto failed; + break; default: