From patchwork Sat Sep 8 00:36:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Baldwin X-Patchwork-Id: 29238 Received: (qmail 28328 invoked by alias); 8 Sep 2018 00:38:17 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 28209 invoked by uid 89); 8 Sep 2018 00:38:15 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=baldwin, Baldwin, displays, jhbfreebsdorg X-HELO: mail.baldwin.cx Received: from bigwig.baldwin.cx (HELO mail.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 08 Sep 2018 00:38:13 +0000 Received: from ralph.com (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id DF9FE10AFD2 for ; Fri, 7 Sep 2018 20:38:11 -0400 (EDT) From: John Baldwin To: gdb-patches@sourceware.org Subject: [PATCH 2/5] Add a new 'info proc files' subcommand of 'info proc'. Date: Fri, 7 Sep 2018 17:36:56 -0700 Message-Id: <20180908003659.37482-3-jhb@FreeBSD.org> In-Reply-To: <20180908003659.37482-1-jhb@FreeBSD.org> References: <20180908003659.37482-1-jhb@FreeBSD.org> X-IsSubscribed: yes 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 d32b390778..2e5cd0a687 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2018-09-07 John Baldwin + + * 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-07 John Baldwin * 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..c6cfc10a49 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 of open files."), + &info_proc_cmdlist); + add_cmd ("all", class_info, info_proc_cmd_all, _("\ List all available /proc info."), &info_proc_cmdlist);