public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [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
@ 2014-11-19 20:38 simon.marchi at ericsson dot com
  2014-11-20 15:33 ` [Bug gdb/17627] " simon.marchi at ericsson dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: simon.marchi at ericsson dot com @ 2014-11-19 20:38 UTC (permalink / raw)
  To: gdb-prs

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 <Thread ID 2> 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.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-12-25  0:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-19 20:38 [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 simon.marchi at ericsson dot com
2014-11-20 15:33 ` [Bug gdb/17627] " simon.marchi at ericsson dot com
2014-12-09 10:07 ` mihai.ciric at gmail dot com
2014-12-09 14:51 ` mihai.ciric at gmail dot com
2014-12-10 18:05 ` cvs-commit at gcc dot gnu.org
2014-12-10 18:07 ` simon.marchi at ericsson dot com
2014-12-17 14:41 ` marc.khouzam at ericsson dot com
2014-12-17 14:47 ` simon.marchi at ericsson dot com
2014-12-25  0:46 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).