From patchwork Wed Sep 25 15:37:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 34653 Received: (qmail 85682 invoked by alias); 25 Sep 2019 15:44:18 -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 85366 invoked by uid 89); 25 Sep 2019 15:44:18 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPAM_BODY, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=H*MI:tom, screen X-HELO: gateway20.websitewelcome.com Received: from gateway20.websitewelcome.com (HELO gateway20.websitewelcome.com) (192.185.68.24) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 25 Sep 2019 15:44:16 +0000 Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 78564400C7E11 for ; Wed, 25 Sep 2019 09:30:46 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id D9LsieZyh90onD9LsiLAYm; Wed, 25 Sep 2019 10:37:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version :Content-Type:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=s9oLChEs815W7kZr9ceGe0OH0AtXkU57O9VSdr37b4c=; b=hlwpiwv7UDVVubJ6hS1B1Jp0YL +AVgF0L+1pGOMMhPr/iwqglFjnYpYJmxzE5rmpT9BTJtjURUxZ1ik4LWSCnoPSVnbypG2mchKssx0 LjEZK1OTITWFmP7Vwnzsshcjj; Received: from 71-218-73-27.hlrn.qwest.net ([71.218.73.27]:42948 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1iD9Ls-0033eu-OO; Wed, 25 Sep 2019 10:37:12 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] Remove initialize_utils Date: Wed, 25 Sep 2019 09:37:09 -0600 Message-Id: <20190925153709.8282-1-tom@tromey.com> initialize_utils only registers some commands, so it isn't necessary to run it at any particular time during startup. This patch removes it and merges its contents into _initialize_utils. Tested by the buildbot. gdb/ChangeLog 2019-09-25 Tom Tromey * utils.h (initialize_utils): Don't declare. * top.c (gdb_init): Don't call initialize_utils. * utils.c (initialize_utils): Remove. Move contents... (_initialize_utils): ... here. --- gdb/ChangeLog | 7 ++++ gdb/top.c | 1 - gdb/utils.c | 98 ++++++++++++++++++++++++--------------------------- gdb/utils.h | 2 -- 4 files changed, 54 insertions(+), 54 deletions(-) diff --git a/gdb/top.c b/gdb/top.c index 49e6daae949..a1a08e0b99e 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -2234,7 +2234,6 @@ gdb_init (char *argv0) init_cmd_lists (); /* This needs to be done first. */ initialize_targets (); /* Setup target_terminal macros for utils.c. */ - initialize_utils (); /* Make errors and warnings possible. */ init_page_info (); diff --git a/gdb/utils.c b/gdb/utils.c index b2535ebefd3..b6a1ed58b20 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -2789,57 +2789,6 @@ show_debug_timestamp (struct ui_file *file, int from_tty, } -void -initialize_utils (void) -{ - add_setshow_uinteger_cmd ("width", class_support, &chars_per_line, _("\ -Set number of characters where GDB should wrap lines of its output."), _("\ -Show number of characters where GDB should wrap lines of its output."), _("\ -This affects where GDB wraps its output to fit the screen width.\n\ -Setting this to \"unlimited\" or zero prevents GDB from wrapping its output."), - set_width_command, - show_chars_per_line, - &setlist, &showlist); - - add_setshow_uinteger_cmd ("height", class_support, &lines_per_page, _("\ -Set number of lines in a page for GDB output pagination."), _("\ -Show number of lines in a page for GDB output pagination."), _("\ -This affects the number of lines after which GDB will pause\n\ -its output and ask you whether to continue.\n\ -Setting this to \"unlimited\" or zero causes GDB never pause during output."), - set_height_command, - show_lines_per_page, - &setlist, &showlist); - - add_setshow_boolean_cmd ("pagination", class_support, - &pagination_enabled, _("\ -Set state of GDB output pagination."), _("\ -Show state of GDB output pagination."), _("\ -When pagination is ON, GDB pauses at end of each screenful of\n\ -its output and asks you whether to continue.\n\ -Turning pagination off is an alternative to \"set height unlimited\"."), - NULL, - show_pagination_enabled, - &setlist, &showlist); - - add_setshow_boolean_cmd ("sevenbit-strings", class_support, - &sevenbit_strings, _("\ -Set printing of 8-bit characters in strings as \\nnn."), _("\ -Show printing of 8-bit characters in strings as \\nnn."), NULL, - NULL, - show_sevenbit_strings, - &setprintlist, &showprintlist); - - add_setshow_boolean_cmd ("timestamp", class_maintenance, - &debug_timestamp, _("\ -Set timestamping of debugging messages."), _("\ -Show timestamping of debugging messages."), _("\ -When set, debugging messages will be marked with seconds and microseconds."), - NULL, - show_debug_timestamp, - &setdebuglist, &showdebuglist); -} - /* See utils.h. */ CORE_ADDR @@ -3448,6 +3397,53 @@ copy_bitwise (gdb_byte *dest, ULONGEST dest_offset, void _initialize_utils (void) { + add_setshow_uinteger_cmd ("width", class_support, &chars_per_line, _("\ +Set number of characters where GDB should wrap lines of its output."), _("\ +Show number of characters where GDB should wrap lines of its output."), _("\ +This affects where GDB wraps its output to fit the screen width.\n\ +Setting this to \"unlimited\" or zero prevents GDB from wrapping its output."), + set_width_command, + show_chars_per_line, + &setlist, &showlist); + + add_setshow_uinteger_cmd ("height", class_support, &lines_per_page, _("\ +Set number of lines in a page for GDB output pagination."), _("\ +Show number of lines in a page for GDB output pagination."), _("\ +This affects the number of lines after which GDB will pause\n\ +its output and ask you whether to continue.\n\ +Setting this to \"unlimited\" or zero causes GDB never pause during output."), + set_height_command, + show_lines_per_page, + &setlist, &showlist); + + add_setshow_boolean_cmd ("pagination", class_support, + &pagination_enabled, _("\ +Set state of GDB output pagination."), _("\ +Show state of GDB output pagination."), _("\ +When pagination is ON, GDB pauses at end of each screenful of\n\ +its output and asks you whether to continue.\n\ +Turning pagination off is an alternative to \"set height unlimited\"."), + NULL, + show_pagination_enabled, + &setlist, &showlist); + + add_setshow_boolean_cmd ("sevenbit-strings", class_support, + &sevenbit_strings, _("\ +Set printing of 8-bit characters in strings as \\nnn."), _("\ +Show printing of 8-bit characters in strings as \\nnn."), NULL, + NULL, + show_sevenbit_strings, + &setprintlist, &showprintlist); + + add_setshow_boolean_cmd ("timestamp", class_maintenance, + &debug_timestamp, _("\ +Set timestamping of debugging messages."), _("\ +Show timestamping of debugging messages."), _("\ +When set, debugging messages will be marked with seconds and microseconds."), + NULL, + show_debug_timestamp, + &setdebuglist, &showdebuglist); + add_internal_problem_command (&internal_error_problem); add_internal_problem_command (&internal_warning_problem); add_internal_problem_command (&demangler_warning_problem); diff --git a/gdb/utils.h b/gdb/utils.h index 7cdc73ef54f..348585cc922 100644 --- a/gdb/utils.h +++ b/gdb/utils.h @@ -28,8 +28,6 @@ struct completion_match_for_lcd; class compiled_regex; -extern void initialize_utils (void); - /* String utilities. */ extern bool sevenbit_strings;