From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24027 invoked by alias); 19 Nov 2014 20:38:01 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 24005 invoked by uid 48); 19 Nov 2014 20:38:00 -0000 From: "simon.marchi at ericsson dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/17627] New: In MI all-stop/mi-async off mode, a thread exit make the prompt (kind of) return, but it shouldn't Date: Wed, 19 Nov 2014 20:38:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simon.marchi at ericsson dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-q4/txt/msg00291.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=17627 Bug ID: 17627 Summary: In MI all-stop/mi-async off mode, a thread exit make the prompt (kind of) return, but it shouldn't Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: simon.marchi at ericsson dot com Created attachment 7953 --> https://sourceware.org/bugzilla/attachment.cgi?id=7953&action=edit Test source file Steps to reproduce: 1. Build the test: gcc -g3 -O0 test.c -pthread 2. Load the binary in gdb/mi (with -nx to get default settings) gdb -i mi -nx a.out 3. Run run or -exec-run The program will spawn a thread which exits immediately. The main thread gets trapped in the infinite for loop. At this point, the program is still running, but we can now type commands. I would not expect to be able to type commands at this point, since we are in mi-async off and the program was never interrupted. Signs that things are in a bad state: - We get the prompt back (we can type stuff), but the (gdb) prompt does not appear. - At this point, when we type "info threads", there is no active selected thread. It says: "The current thread has terminated.". For fun, you can try typing "interrupt" or "-exec-interrupt" after. It will put back gdb in a good state, with a valid selected thread and the prompt comes back. -- You are receiving this mail because: You are on the CC list for the bug.