From: John Baldwin <jhb@FreeBSD.org>
To: gdb-patches@sourceware.org
Subject: [PATCH v2 2/6] Add a new 'info proc files' subcommand of 'info proc'.
Date: Wed, 12 Sep 2018 23:37:00 -0000 [thread overview]
Message-ID: <20180912233707.43492-3-jhb@FreeBSD.org> (raw)
In-Reply-To: <20180912233707.43492-1-jhb@FreeBSD.org>
This command displays a list of open file descriptors.
gdb/ChangeLog:
* defs.h (enum info_proc_what) [IP_FILES]: New value.
* infcmd.c (info_proc_cmd_files): New function.
(_initialize_infcmd): Register 'info proc files' command.
---
gdb/ChangeLog | 6 ++++++
gdb/defs.h | 3 +++
gdb/infcmd.c | 12 ++++++++++++
3 files changed, 21 insertions(+)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d602e63eb0..e504219625 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2018-09-12 John Baldwin <jhb@FreeBSD.org>
+
+ * defs.h (enum info_proc_what) [IP_FILES]: New value.
+ * infcmd.c (info_proc_cmd_files): New function.
+ (_initialize_infcmd): Register 'info proc files' command.
+
2018-09-12 John Baldwin <jhb@FreeBSD.org>
* fbsd-tdep.c (fbsd_core_vnode_path): Use KF_PATH instead of
diff --git a/gdb/defs.h b/gdb/defs.h
index fc4217005a..6e3f4df116 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -389,6 +389,9 @@ enum info_proc_what
/* * Display `info proc cwd'. */
IP_CWD,
+ /* * Display `info proc files'. */
+ IP_FILES,
+
/* * Display all of the above. */
IP_ALL
};
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 860909f5e2..5fcb872c98 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -3218,6 +3218,14 @@ info_proc_cmd_exe (const char *args, int from_tty)
info_proc_cmd_1 (args, IP_EXE, from_tty);
}
+/* Implement `info proc files'. */
+
+static void
+info_proc_cmd_files (const char *args, int from_tty)
+{
+ info_proc_cmd_1 (args, IP_FILES, from_tty);
+}
+
/* Implement `info proc all'. */
static void
@@ -3543,6 +3551,10 @@ List command line arguments of the process."),
List absolute filename for executable of the process."),
&info_proc_cmdlist);
+ add_cmd ("files", class_info, info_proc_cmd_files, _("\
+List files opened by the specified process."),
+ &info_proc_cmdlist);
+
add_cmd ("all", class_info, info_proc_cmd_all, _("\
List all available /proc info."),
&info_proc_cmdlist);
--
2.18.0
next prev parent reply other threads:[~2018-09-12 23:37 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-12 23:37 [PATCH v2 0/6] Add a new 'info proc files' command John Baldwin
2018-09-12 23:37 ` [PATCH v2 3/6] Add support for 'info proc files' on FreeBSD core dumps John Baldwin
2018-09-16 2:27 ` Simon Marchi
2018-09-17 16:54 ` John Baldwin
2018-09-12 23:37 ` John Baldwin [this message]
2018-09-12 23:37 ` [PATCH v2 6/6] Make the "info proc" documentation more consistent John Baldwin
2018-09-13 13:40 ` Eli Zaretskii
2018-09-12 23:37 ` [PATCH v2 1/6] Use KF_PATH to verify the size of a struct kinfo_file John Baldwin
2018-09-12 23:37 ` [PATCH v2 5/6] Document the 'info proc files' command John Baldwin
2018-09-13 13:39 ` Eli Zaretskii
2018-09-12 23:43 ` [PATCH v2 4/6] Support 'info proc files' on live FreeBSD processes John Baldwin
2018-09-16 2:34 ` [PATCH v2 0/6] Add a new 'info proc files' command Simon Marchi
2018-09-17 16:59 ` John Baldwin
2018-09-17 17:17 ` Simon Marchi
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=20180912233707.43492-3-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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).