public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/17626] New: attach, detach, attach did not work
@ 2014-11-19 16:19 tromey at sourceware dot org
  2014-11-19 16:36 ` [Bug gdb/17626] " palves at redhat dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: tromey at sourceware dot org @ 2014-11-19 16:19 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 17626
           Summary: attach, detach, attach did not work
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: tromey at sourceware dot org

I'm debugging firefox in "electrolysis" mode, where it
has two processes.  I used git gdb from a couple weeks ago.

First I attached to the parent process.  This went fine:

(gdb) attach 8126
Attaching to process 8126
Reading symbols from
/home/tromey/firefox-git/gecko-dev/obj-x86_64-unknown-linux-gnu/dist/bin/firefox...done.
[...lots more...]
0x00007facdb22c71d in poll () at ../sysdeps/unix/syscall-template.S:81


Now I detach immediately and try to attach to the child:

(gdb) detach
Detaching from program:
/home/tromey/firefox-git/gecko-dev/obj-x86_64-unknown-linux-gnu/dist/bin/firefox,
process 8126
[Inferior 8126 detached]
(gdb) attach 8189
Attaching to program:
/home/tromey/firefox-git/gecko-dev/obj-x86_64-unknown-linux-gnu/dist/bin/firefox,
process 8189
Reading symbols from /lib64/ld-linux-x86-64.so.2...Reading symbols from
/usr/lib/debug/usr/lib64/ld-2.18.so.debug...done.
done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
0x00007f573f1f171d in ?? ()

gdb can't find the threads or do a stack trace:

(gdb) info thr
  Id   Target Id         Frame 
* 1    process 8189 "Web Content" 0x00007f573f1f171d in ?? ()
(gdb) bt
#0  0x00007f573f1f171d in ?? ()
#1  0x0000000000000000 in ?? ()


However, if I quit gdb and attach to the child, it works.

(gdb) attach 8189
Attaching to process 8189
Reading symbols from
/home/tromey/firefox-git/gecko-dev/obj-x86_64-unknown-linux-gnu/dist/bin/plugin-container...done.
[...lots more...]

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


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

* [Bug gdb/17626] attach, detach, attach did not work
  2014-11-19 16:19 [Bug gdb/17626] New: attach, detach, attach did not work tromey at sourceware dot org
@ 2014-11-19 16:36 ` palves at redhat dot com
  2014-11-19 21:01 ` tromey at sourceware dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: palves at redhat dot com @ 2014-11-19 16:36 UTC (permalink / raw)
  To: gdb-prs

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

Pedro Alves <palves at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |palves at redhat dot com

--- Comment #1 from Pedro Alves <palves at redhat dot com> ---
> Now I detach immediately and try to attach to the child:

In this case, the inferior still has the parent's executable loaded:

...
> Attaching to program: ...bin/firefox, process 8189
                               ^^^^^^^

while in this case, you don't have an executable loaded, and so GDB
fetches the right one:

> However, if I quit gdb and attach to the child, it works.
...
> Reading symbols from ...bin/plugin-container...done.
                              ^^^^^^^^^^^^^^^^

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


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

* [Bug gdb/17626] attach, detach, attach did not work
  2014-11-19 16:19 [Bug gdb/17626] New: attach, detach, attach did not work tromey at sourceware dot org
  2014-11-19 16:36 ` [Bug gdb/17626] " palves at redhat dot com
@ 2014-11-19 21:01 ` tromey at sourceware dot org
  2015-05-11 13:42 ` palves at redhat dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: tromey at sourceware dot org @ 2014-11-19 21:01 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

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

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
(In reply to Pedro Alves from comment #1)

> while in this case, you don't have an executable loaded, and so GDB
> fetches the right one:

Thanks Pedro.
I am bit by this every couple of years and seemingly
can't remember the symptoms.
I've even filed it before (I thought more than once, since
IIRC I wrote a patch a long time ago... but I could only
find bug 16266 this time).

*** This bug has been marked as a duplicate of bug 16266 ***

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


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

* [Bug gdb/17626] attach, detach, attach did not work
  2014-11-19 16:19 [Bug gdb/17626] New: attach, detach, attach did not work tromey at sourceware dot org
  2014-11-19 16:36 ` [Bug gdb/17626] " palves at redhat dot com
  2014-11-19 21:01 ` tromey at sourceware dot org
@ 2015-05-11 13:42 ` palves at redhat dot com
  2015-06-05 13:36 ` tromey at sourceware dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: palves at redhat dot com @ 2015-05-11 13:42 UTC (permalink / raw)
  To: gdb-prs

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

Pedro Alves <palves at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|DUPLICATE                   |---

--- Comment #3 from Pedro Alves <palves at redhat dot com> ---
We're discussing this here:

 https://sourceware.org/ml/gdb-patches/2015-05/msg00090.html

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


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

* [Bug gdb/17626] attach, detach, attach did not work
  2014-11-19 16:19 [Bug gdb/17626] New: attach, detach, attach did not work tromey at sourceware dot org
                   ` (2 preceding siblings ...)
  2015-05-11 13:42 ` palves at redhat dot com
@ 2015-06-05 13:36 ` tromey at sourceware dot org
  2024-01-02 17:23 ` ssbssa at sourceware dot org
  2024-01-10 23:20 ` tromey at sourceware dot org
  5 siblings, 0 replies; 7+ messages in thread
From: tromey at sourceware dot org @ 2015-06-05 13:36 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from Tom Tromey <tromey at sourceware dot org> ---
(In reply to Gary Benson from comment #4)
> Version 2 patch here:
> 
>  https://sourceware.org/ml/gdb-patches/2015-06/msg00080.html

I'm curious why it doesn't check the buildid.
It seems to me that if the current file has a buildid
and the attach target has a buildid, and they do not match,
then discarding the current file is the best thing to do.
My recollection is that gdb can't always do this because
(on systems without buildid) the user might have meant to do
this weird thing.  But when buildid is available can it ever
be meaningful?

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


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

* [Bug gdb/17626] attach, detach, attach did not work
  2014-11-19 16:19 [Bug gdb/17626] New: attach, detach, attach did not work tromey at sourceware dot org
                   ` (3 preceding siblings ...)
  2015-06-05 13:36 ` tromey at sourceware dot org
@ 2024-01-02 17:23 ` ssbssa at sourceware dot org
  2024-01-10 23:20 ` tromey at sourceware dot org
  5 siblings, 0 replies; 7+ messages in thread
From: ssbssa at sourceware dot org @ 2024-01-02 17:23 UTC (permalink / raw)
  To: gdb-prs

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

Hannes Domani <ssbssa at sourceware dot org> changed:

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

--- Comment #7 from Hannes Domani <ssbssa at sourceware dot org> ---
(In reply to Sourceware Commits from comment #6)
>     This fixes PR gdb/17626.

Sounds like this can be closed?

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

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

* [Bug gdb/17626] attach, detach, attach did not work
  2014-11-19 16:19 [Bug gdb/17626] New: attach, detach, attach did not work tromey at sourceware dot org
                   ` (4 preceding siblings ...)
  2024-01-02 17:23 ` ssbssa at sourceware dot org
@ 2024-01-10 23:20 ` tromey at sourceware dot org
  5 siblings, 0 replies; 7+ messages in thread
From: tromey at sourceware dot org @ 2024-01-10 23:20 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

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

--- Comment #8 from Tom Tromey <tromey at sourceware dot org> ---
Seems like it.

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

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

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

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-19 16:19 [Bug gdb/17626] New: attach, detach, attach did not work tromey at sourceware dot org
2014-11-19 16:36 ` [Bug gdb/17626] " palves at redhat dot com
2014-11-19 21:01 ` tromey at sourceware dot org
2015-05-11 13:42 ` palves at redhat dot com
2015-06-05 13:36 ` tromey at sourceware dot org
2024-01-02 17:23 ` ssbssa at sourceware dot org
2024-01-10 23:20 ` tromey 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).