public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug mi/15564] New: MI thread-exited event inconsistency when detaching
@ 2013-06-03 16:05 simon.marchi at ericsson dot com
  2015-06-02 19:34 ` [Bug mi/15564] " cvs-commit at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: simon.marchi at ericsson dot com @ 2013-06-03 16:05 UTC (permalink / raw)
  To: gdb-prs

http://sourceware.org/bugzilla/show_bug.cgi?id=15564

            Bug ID: 15564
           Summary: MI thread-exited event inconsistency when detaching
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mi
          Assignee: unassigned at sourceware dot org
          Reporter: simon.marchi at ericsson dot com

When attaching and detaching a process, we see two different behavior depending
on if we pass through a gdbserver or if we do it natively. The difference is
whether the thread-exited event is emitted or not.


Attaching and detaching a process without directly (no gdbserver)
$ gdb -i mi
=thread-group-added,id="i1"
(gdb)
-target-attach 5422
=thread-group-started,id="i1",pid="5422"
=thread-created,id="1",group-id="i1"
=library-loaded,id="/lib/x86_64-linux-gnu/libc.so.6",target-name="/lib/x86_64-linux-gnu/libc.so.6",host-name="/lib/x86_64-linux-gnu/libc.so.6",symbols-loaded="0",thread-group="i1"
=library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1"
*stopped,frame={addr="0x00007fe48e131d20",func="nanosleep",args=[],from="/lib/x86_64-linux-gnu/libc.so.6"},thread-id="1",stopped-threads="all",core="1"
^done
(gdb)
-target-detach
=thread-group-exited,id="i1"
=library-unloaded,id="/lib/x86_64-linux-gnu/libc.so.6",target-name="/lib/x86_64-linux-gnu/libc.so.6",host-name="/lib/x86_64-linux-gnu/libc.so.6",thread-group="i1"
=library-unloaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",thread-group="i1"
^done
(gdb)


Attaching and detaching a process through gdbserver
(start gdbserver and attach the process)
$ gdbserver --attach :1234 5422

$ gdb -i mi
=thread-group-added,id="i1"
(gdb)
-target-select extended-remote :1234
=thread-group-started,id="i1",pid="5422"
=thread-created,id="1",group-id="i1"

&"warning: Could not load vsyscall page because no executable was
specified\ntry using the \"file\" command first."

&"\n"
*stopped,frame={addr="0x00007fe48e131d20",func="??",args=[]},thread-id="1",stopped-threads="all",core="3"
=tsv-created,name="trace_timestamp",initial="0"\n
^connected
(gdb)
-target-detach
=thread-exited,id="1",group-id="i1"
=thread-group-exited,id="i1"
^done
(gdb)

Reference: http://sourceware.org/ml/gdb/2013-05/msg00149.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug mi/15564] MI thread-exited event inconsistency when detaching
  2013-06-03 16:05 [Bug mi/15564] New: MI thread-exited event inconsistency when detaching simon.marchi at ericsson dot com
@ 2015-06-02 19:34 ` cvs-commit at gcc dot gnu.org
  2015-06-03 14:18 ` simon.marchi at ericsson dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2015-06-02 19:34 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=15564

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Simon Marchi <simark@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3b462ec2bedca7392bf4720db44fdf2a46ad8b4d

commit 3b462ec2bedca7392bf4720db44fdf2a46ad8b4d
Author: Simon Marchi <simon.marchi@ericsson.com>
Date:   Tue Jun 2 15:32:40 2015 -0400

    Fix =thread-exited not showing up when detaching (PR 15564)

    I sent a patch in 2013 for this (incorrectly named =thread-created):

      https://cygwin.com/ml/gdb-patches/2013-06/msg00129.html

    Tom Tromey was ok with the change, but suggested to add a test as well.
    Then I forgot about this patch until today. So here it is again, with the
    corresponding test.

    The problem is that the =thread-exited event does not appear when detaching
    from a local process. It does appear with remote though. It's not a really
    big deal, but I'd like it to be consistent.

    Tested with local and remote Linux on my Ubuntu 14.04.

    gdb/ChangeLog:

        PR gdb/15564
        * inferior.c (detach_inferior): Call exit_inferior_1 with silent = 0.

    gdb/testsuite/ChangeLog:

        PR gdb/15564
        * gdb.mi/mi-detach.exp: New file.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug mi/15564] MI thread-exited event inconsistency when detaching
  2013-06-03 16:05 [Bug mi/15564] New: MI thread-exited event inconsistency when detaching simon.marchi at ericsson dot com
  2015-06-02 19:34 ` [Bug mi/15564] " cvs-commit at gcc dot gnu.org
@ 2015-06-03 14:18 ` simon.marchi at ericsson dot com
  2015-10-27 17:26 ` qiyao at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: simon.marchi at ericsson dot com @ 2015-06-03 14:18 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=15564

Simon Marchi <simon.marchi at ericsson dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Simon Marchi <simon.marchi at ericsson dot com> ---
Fixed by commit above.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug mi/15564] MI thread-exited event inconsistency when detaching
  2013-06-03 16:05 [Bug mi/15564] New: MI thread-exited event inconsistency when detaching simon.marchi at ericsson dot com
  2015-06-02 19:34 ` [Bug mi/15564] " cvs-commit at gcc dot gnu.org
  2015-06-03 14:18 ` simon.marchi at ericsson dot com
@ 2015-10-27 17:26 ` qiyao at gcc dot gnu.org
  2015-10-27 17:29 ` simon.marchi at ericsson dot com
  2024-01-13 20:04 ` ssbssa at sourceware dot org
  4 siblings, 0 replies; 6+ messages in thread
From: qiyao at gcc dot gnu.org @ 2015-10-27 17:26 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=15564

Yao Qi <qiyao at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |qiyao at gcc dot gnu.org
         Resolution|FIXED                       |---

--- Comment #3 from Yao Qi <qiyao at gcc dot gnu.org> ---
The test still fails when testing with GDBserver.

-target-detach^M
=thread-group-exited,id="i1"^M
=library-unloaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="target:/lib64/ld-linux-x86-64.so.2",thread-group="i1"^M
=library-unloaded,id="/lib/x86_64-linux-gnu/libc.so.6",target-name="/lib/x86_64-linux-gnu/libc.so.6",host-name="target:/lib/x86_64-linux-gnu/libc.so.6",thread-group="i1"^M
^done^M
(gdb) ^M
FAIL: gdb.mi/mi-detach.exp: detach

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug mi/15564] MI thread-exited event inconsistency when detaching
  2013-06-03 16:05 [Bug mi/15564] New: MI thread-exited event inconsistency when detaching simon.marchi at ericsson dot com
                   ` (2 preceding siblings ...)
  2015-10-27 17:26 ` qiyao at gcc dot gnu.org
@ 2015-10-27 17:29 ` simon.marchi at ericsson dot com
  2024-01-13 20:04 ` ssbssa at sourceware dot org
  4 siblings, 0 replies; 6+ messages in thread
From: simon.marchi at ericsson dot com @ 2015-10-27 17:29 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=15564

--- Comment #4 from Simon Marchi <simon.marchi at ericsson dot com> ---
There is a patch posted for that, but it needs to be re-worked after comments
by Pedro.

https://sourceware.org/ml/gdb-patches/2015-09/msg00047.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug mi/15564] MI thread-exited event inconsistency when detaching
  2013-06-03 16:05 [Bug mi/15564] New: MI thread-exited event inconsistency when detaching simon.marchi at ericsson dot com
                   ` (3 preceding siblings ...)
  2015-10-27 17:29 ` simon.marchi at ericsson dot com
@ 2024-01-13 20:04 ` ssbssa at sourceware dot org
  4 siblings, 0 replies; 6+ messages in thread
From: ssbssa at sourceware dot org @ 2024-01-13 20:04 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=15564

Hannes Domani <ssbssa at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ssbssa at sourceware dot org

--- Comment #5 from Hannes Domani <ssbssa at sourceware dot org> ---
I wonder if the remaining problem was fixed with this commit:
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=a78ef8757418105c35685c5d82b9fdf79459321b

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2024-01-13 20:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-03 16:05 [Bug mi/15564] New: MI thread-exited event inconsistency when detaching simon.marchi at ericsson dot com
2015-06-02 19:34 ` [Bug mi/15564] " cvs-commit at gcc dot gnu.org
2015-06-03 14:18 ` simon.marchi at ericsson dot com
2015-10-27 17:26 ` qiyao at gcc dot gnu.org
2015-10-27 17:29 ` simon.marchi at ericsson dot com
2024-01-13 20:04 ` ssbssa at sourceware dot 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).