This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Suggest running gdbserver for a PID in container


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

commit 708bf0a14b10d801a600759f3ef6d272978ae854
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Thu Mar 17 18:17:30 2016 +0100

    Suggest running gdbserver for a PID in container
    
    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
    
    It correctly states the problem but it does not say how to solve it.
    
    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.
    
    gdb/ChangeLog
    2016-03-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
    
    	* linux-thread-db.c (check_pid_namespace_match): Extend the message.

Diff:
---
 gdb/ChangeLog         | 4 ++++
 gdb/linux-thread-db.c | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f5099d9..2df6ccd 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,7 @@
+2016-03-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	* linux-thread-db.c (check_pid_namespace_match): Extend the message.
+
 2016-03-17  Pedro Alves  <palves@redhat.com>
 	    Don Breazeal  <donb@codesourcery.com>
 
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
index ce60beb..992965f 100644
--- a/gdb/linux-thread-db.c
+++ b/gdb/linux-thread-db.c
@@ -1024,7 +1024,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."));
 	}
     }
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]