From patchwork Tue Feb 14 10:01:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Kolesov X-Patchwork-Id: 19250 Received: (qmail 97882 invoked by alias); 14 Feb 2017 10:01:48 -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 97773 invoked by uid 89); 14 Feb 2017 10:01:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.6 required=5.0 tests=AWL, BAYES_50, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=H*RU:sk:smtprel, Hx-spam-relays-external:sk:smtprel, HX-HELO:sk:smtprel, add_prefix_cmd X-HELO: smtprelay.synopsys.com Received: from smtprelay4.synopsys.com (HELO smtprelay.synopsys.com) (198.182.47.9) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 14 Feb 2017 10:01:39 +0000 Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id 25F1D24E1083 for ; Tue, 14 Feb 2017 02:01:38 -0800 (PST) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 104A1270; Tue, 14 Feb 2017 02:01:38 -0800 (PST) Received: from akolesov-lab.internal.synopsys.com (akolesov-lab.internal.synopsys.com [10.121.8.134]) by mailhost.synopsys.com (Postfix) with ESMTP id 0699C231; Tue, 14 Feb 2017 02:01:36 -0800 (PST) From: Anton Kolesov To: gdb-patches@sourceware.org Cc: Anton Kolesov , Francois Bedard Subject: [PATCH 3/5] arc: Add "maintenance print arc" command prefix Date: Tue, 14 Feb 2017 13:01:28 +0300 Message-Id: <20170214100130.29194-3-Anton.Kolesov@synopsys.com> In-Reply-To: <20170214100130.29194-1-Anton.Kolesov@synopsys.com> References: <20170214100130.29194-1-Anton.Kolesov@synopsys.com> Add an "arc" sublist to "maintenance print" command list. The list is empty for now, its purpose is to contain commands that print internal state of some ARC-specific structures. gdb/ChangeLog: yyyy-mm-dd Anton Kolesov * arc-tdep (maintenance_print_arc_list): New variable. (maintenance_print_arc_command): New function. --- gdb/arc-tdep.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c index e4b2e7a..5495f2e 100644 --- a/gdb/arc-tdep.c +++ b/gdb/arc-tdep.c @@ -59,6 +59,10 @@ struct arc_frame_cache int arc_debug; +/* List of "maintenance print arc" commands. */ + +static struct cmd_list_element *maintenance_print_arc_list = NULL; + /* XML target description features. */ static const char core_v2_feature_name[] = "org.gnu.gdb.arc.core.v2"; @@ -1318,6 +1322,14 @@ arc_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file) fprintf_unfiltered (file, "arc_dump_tdep: jb_pc = %i\n", tdep->jb_pc); } +/* Wrapper for "maintenance print arc" list of commands. */ + +static void +maintenance_print_arc_command (char *args, int from_tty) +{ + cmd_show_list (maintenance_print_arc_list, from_tty, ""); +} + /* Suppress warning from -Wmissing-prototypes. */ extern initialize_file_ftype _initialize_arc_tdep; @@ -1331,6 +1343,13 @@ _initialize_arc_tdep (void) /* Register ARC-specific commands with gdb. */ + /* Add root prefix command for "maintenance print arc" commands. */ + add_prefix_cmd ("arc", class_maintenance, maintenance_print_arc_command, + _("ARC-specific maintenance commands for printing GDB " + "internal state."), + &maintenance_print_arc_list, "maintenance print arc ", 0, + &maintenanceprintlist); + /* Debug internals for ARC GDB. */ add_setshow_zinteger_cmd ("arc", class_maintenance, &arc_debug,