This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch] Suggest running gdbserver for a PID in container
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: Daniel Colascione <dancol at dancol dot org>, Gary Benson <gbenson at redhat dot com>
- Date: Tue, 15 Mar 2016 23:07:50 +0100
- Subject: [patch] Suggest running gdbserver for a PID in container
- Authentication-results: sourceware.org; auth=none
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.
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."));
}
}
}