Add message suggesting gdbserver for non-matching PID namespaces.

This commit is contained in:
Jan Kratochvil 2016-03-17 21:57:11 +01:00
parent b84e3d603f
commit 04d3aefc17
2 changed files with 64 additions and 1 deletions

View File

@ -153,3 +153,63 @@ index 1eb457d..ce60beb 100644
--
2.5.0
http://sourceware.org/ml/gdb-patches/2016-03/msg00246.html
Subject: [patch] Suggest running gdbserver for a PID in container
--azLHFNyN32YCQGCU
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
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
--azLHFNyN32YCQGCU
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline; filename=1
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."));
}
}
}
--azLHFNyN32YCQGCU--

View File

@ -27,7 +27,7 @@ Version: 7.11
# The release always contains a leading reserved number, start it at 1.
# `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
Release: 60%{?dist}
Release: 61%{?dist}
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain and GFDL
Group: Development/Debuggers
@ -1393,6 +1393,9 @@ then
fi
%changelog
* Thu Mar 17 2016 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.11-61.fc24
- Add message suggesting gdbserver for non-matching PID namespaces.
* Tue Mar 15 2016 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.11-60.fc24
- New Fedora GDB testfile: rhbz1261564-aarch64-watchpoint.exp
- Backport gdb-7.11 stable branch PR gdb/19676 fix (Pedro Alves).