Message ID | 20160315220750.GA24570@host1.jankratochvil.net |
---|---|
State | New, archived |
Headers |
Received: (qmail 59962 invoked by alias); 15 Mar 2016 22:08:08 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 59947 invoked by uid 89); 15 Mar 2016 22:08:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Connect, 1234, Gary, Suggest X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 15 Mar 2016 22:07:55 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id C28787F6B1; Tue, 15 Mar 2016 22:07:54 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-22.ams2.redhat.com [10.36.116.22]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2FM7oUO014643 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 15 Mar 2016 18:07:53 -0400 Date: Tue, 15 Mar 2016 23:07:50 +0100 From: Jan Kratochvil <jan.kratochvil@redhat.com> To: gdb-patches@sourceware.org Cc: Daniel Colascione <dancol@dancol.org>, Gary Benson <gbenson@redhat.com> Subject: [patch] Suggest running gdbserver for a PID in container Message-ID: <20160315220750.GA24570@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="azLHFNyN32YCQGCU" Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes |
Commit Message
Jan Kratochvil
March 15, 2016, 10:07 p.m. UTC
Hi, currently gdb -p <pid from a container> will print: warning: Target and debugger are in different PID namespaces; thread lists and other data are likely unreliable BTW it is a bit lost in all the other messages. Full screen output is in: https://sourceware.org/bugzilla/show_bug.cgi?id=19828 It correctly states the problem but it does not say how to solve it. Is at least this little suggestion OK? Originally I wanted to suggest also the Docker "-p 1234:1234" parameter but I see the containers are more general topic than just Docker (even LxC etc.). According to Gary future GDBs should be able to work even without gdbserver. But currently gdbserver is still required. Thanks, Jan gdb/ChangeLog 2016-03-15 Jan Kratochvil <jan.kratochvil@redhat.com> * linux-thread-db.c (check_pid_namespace_match): Extend the message.
Comments
On 03/15/2016 03:07 PM, Jan Kratochvil wrote: > Hi, > > currently > gdb -p <pid from a container> > will print: > warning: Target and debugger are in different PID namespaces; thread lists and other data are likely unreliable > > BTW it is a bit lost in all the other messages. Full screen output is in: > https://sourceware.org/bugzilla/show_bug.cgi?id=19828 > > It correctly states the problem but it does not say how to solve it. We (FB) just treat the container as an entirely separate machine and debug processes inside it using gdbserver.
On 03/15/2016 10:07 PM, Jan Kratochvil wrote: > Hi, > > currently > gdb -p <pid from a container> > will print: > warning: Target and debugger are in different PID namespaces; thread lists and other data are likely unreliable > > BTW it is a bit lost in all the other messages. Full screen output is in: > https://sourceware.org/bugzilla/show_bug.cgi?id=19828 > > It correctly states the problem but it does not say how to solve it. > > Is at least this little suggestion OK? OK. > Originally I wanted to suggest also the Docker "-p 1234:1234" parameter but > I see the containers are more general topic than just Docker (even LxC etc.). > > According to Gary future GDBs should be able to work even without gdbserver. > But currently gdbserver is still required. Yes, when/if Infinity notes are accepted in glibc. Thanks, Pedro Alves
On Thu, 17 Mar 2016 12:13:45 +0100, Pedro Alves wrote: > On 03/15/2016 10:07 PM, Jan Kratochvil wrote: > > Is at least this little suggestion OK? > > OK. Checked in: 708bf0a14b10d801a600759f3ef6d272978ae854 Thanks, Jan
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index 1eb457d..21166bf 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -1020,7 +1020,8 @@ check_pid_namespace_match (void) { warning (_ ("Target and debugger are in different PID " "namespaces; thread lists and other data are " - "likely unreliable")); + "likely unreliable. " + "Connect to gdbserver inside the container.")); } } }