From: John Baldwin <jhb@FreeBSD.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 0/5] Add a new 'info proc files' command
Date: Sat, 08 Sep 2018 00:38:00 -0000 [thread overview]
Message-ID: <20180908003659.37482-1-jhb@FreeBSD.org> (raw)
This series adds a new 'info proc files' subcommand of 'info proc'.
This subcommand lists information about the open file descriptors of a
process similar to how 'info proc mappings' lists information about
the active virtual memory mappings of a process. The series includes
support for reading the list of file descriptors from both process
core dumps and live processes under FreeBSD.
I've included some sample output below from a live ssh process. One
possibly odd thing to note is that FreeBSD includes some "special"
files in the list of open files that are not actual file descriptors,
but other files that each process references such as the current
working directory, the root directory (affected by chroot), the
controlling tty, etc.
(gdb) info proc files 22136
process 22136
Open files:
FD Type Offset Flags Name
text file - r-------- /usr/bin/slogin
ctty chr - rw------- /dev/pts/20
cwd dir - r-------- /usr/home/john
root dir - r-------- /
0 chr 0x32933a4 rw------- /dev/pts/20
1 chr 0x32933a4 rw------- /dev/pts/20
2 chr 0x32933a4 rw------- /dev/pts/20
3 socket 0x0 rw----n-- tcp4 10.0.1.2:53014 -> 10.0.1.10:22
4 socket 0x0 rw------- unix stream:/tmp/ssh-FIt89oAzOn5f/agent.2456
5 chr 0x32933a4 rw------- /dev/pts/20
6 chr 0x32933a4 rw------- /dev/pts/20
7 chr 0x32933a4 rw------- /dev/pts/20
John Baldwin (5):
Use KF_PATH to verify the size of a struct kinfo_file.
Add a new 'info proc files' subcommand of 'info proc'.
Add support for 'info proc files' on FreeBSD core dumps.
Support 'info proc files' on live FreeBSD processes.
Document the 'info proc files' command.
gdb/ChangeLog | 51 +++++
gdb/NEWS | 3 +
gdb/defs.h | 3 +
gdb/doc/ChangeLog | 5 +
gdb/doc/gdb.texinfo | 8 +
gdb/fbsd-nat.c | 44 ++++-
gdb/fbsd-tdep.c | 443 +++++++++++++++++++++++++++++++++++++++++++-
gdb/fbsd-tdep.h | 31 ++++
gdb/infcmd.c | 12 ++
9 files changed, 597 insertions(+), 3 deletions(-)
--
2.18.0
next reply other threads:[~2018-09-08 0:38 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-08 0:38 John Baldwin [this message]
2018-09-08 0:38 ` [PATCH 3/5] Add support for 'info proc files' on FreeBSD core dumps John Baldwin
2018-09-08 22:54 ` Simon Marchi
2018-09-10 19:37 ` John Baldwin
2018-09-13 15:08 ` Tom Tromey
2018-09-13 18:42 ` John Baldwin
2018-09-08 0:38 ` [PATCH 1/5] Use KF_PATH to verify the size of a struct kinfo_file John Baldwin
2018-09-08 22:25 ` Simon Marchi
2018-09-08 0:38 ` [PATCH 2/5] Add a new 'info proc files' subcommand of 'info proc' John Baldwin
2018-09-08 6:49 ` Eli Zaretskii
2018-09-08 22:31 ` Simon Marchi
2018-09-09 5:23 ` Eli Zaretskii
2018-09-10 18:43 ` John Baldwin
2018-09-10 19:11 ` Eli Zaretskii
2018-09-08 22:32 ` Simon Marchi
2018-09-08 0:46 ` [PATCH 5/5] Document the 'info proc files' command John Baldwin
2018-09-08 7:01 ` Eli Zaretskii
2018-09-10 18:43 ` John Baldwin
2018-09-10 19:13 ` Eli Zaretskii
2018-09-10 18:52 ` John Baldwin
2018-09-08 0:46 ` [PATCH 4/5] Support 'info proc files' on live FreeBSD processes John Baldwin
2018-09-08 23:01 ` Simon Marchi
2018-09-10 18:30 ` John Baldwin
2018-09-10 19:03 ` Simon Marchi
2018-09-12 22:38 ` John Baldwin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180908003659.37482-1-jhb@FreeBSD.org \
--to=jhb@freebsd.org \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox