public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Add a new 'info proc files' command
@ 2018-09-08  0:38 John Baldwin
  2018-09-08  0:38 ` [PATCH 3/5] Add support for 'info proc files' on FreeBSD core dumps John Baldwin
                   ` (4 more replies)
  0 siblings, 5 replies; 25+ messages in thread
From: John Baldwin @ 2018-09-08  0:38 UTC (permalink / raw)
  To: gdb-patches

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

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2018-09-13 18:42 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-08  0:38 [PATCH 0/5] Add a new 'info proc files' command John Baldwin
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 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: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: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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).