From patchwork Thu Jan 23 00:56:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 37499 Received: (qmail 82900 invoked by alias); 23 Jan 2020 00:57:54 -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 80749 invoked by uid 89); 23 Jan 2020 00:57:36 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: gateway24.websitewelcome.com Received: from gateway24.websitewelcome.com (HELO gateway24.websitewelcome.com) (192.185.50.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 23 Jan 2020 00:57:27 +0000 Received: from cm10.websitewelcome.com (cm10.websitewelcome.com [100.42.49.4]) by gateway24.websitewelcome.com (Postfix) with ESMTP id A24E219356 for ; Wed, 22 Jan 2020 18:57:25 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id uQoHityN3keyDuQoHiwlT9; Wed, 22 Jan 2020 18:57:25 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To: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:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=QVmh/Q1MK6ECihGYXzFvdlbb8JvsSsX1CDMCFs2U4a8=; b=OjK2f/NqA4Q9EYuz9JxNJkIYta 2hq7o7YQKnF3nxAokGZyjETTvZ6P4xoQ63rim9na0zzj5u1oPMGacb09606NzC5+NGd6Q7L/h8y/+ 86FKhFghM5M53Bi13WiFJgb02; Received: from 75-166-123-50.hlrn.qwest.net ([75.166.123.50]:40828 helo=bapiya.Home) by box5379.bluehost.com with esmtpa (Exim 4.92) (envelope-from ) id 1iuQoH-004Kmd-DT; Wed, 22 Jan 2020 17:57:25 -0700 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH 24/38] Move dwarf_always_disassemble to dwarf2/loc.c Date: Wed, 22 Jan 2020 17:56:56 -0700 Message-Id: <20200123005710.7978-25-tom@tromey.com> In-Reply-To: <20200123005710.7978-1-tom@tromey.com> References: <20200123005710.7978-1-tom@tromey.com> dwarf_always_disassemble is only used in dwarf2/loc.c, so move the definition and the command infrastructure to that file. 2020-01-22 Tom Tromey * dwarf2/read.c (dwarf_always_disassemble) (show_dwarf_always_disassemble): Move to loc.c. (_initialize_dwarf2_read): Move "always-disassemble" registration to loc.c. * dwarf2/read.h (dwarf_always_disassemble): Don't declare. * dwarf2/loc.c (dwarf_always_disassemble): Move from read.c. Now static. (show_dwarf_always_disassemble): Move from read.c. (_initialize_dwarf2loc): Move always-disassemble from read.c. Change-Id: I33fb88112e98e583c3f4919d20e4d100f2ea0124 --- gdb/ChangeLog | 12 ++++++++++++ gdb/dwarf2/loc.c | 24 ++++++++++++++++++++++++ gdb/dwarf2/read.c | 24 ------------------------ gdb/dwarf2/read.h | 2 -- 4 files changed, 36 insertions(+), 26 deletions(-) diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c index 03333602820..e337a02d473 100644 --- a/gdb/dwarf2/loc.c +++ b/gdb/dwarf2/loc.c @@ -4177,6 +4177,18 @@ disassemble_dwarf_expression (struct ui_file *stream, return data; } +static bool dwarf_always_disassemble; + +static void +show_dwarf_always_disassemble (struct ui_file *file, int from_tty, + struct cmd_list_element *c, const char *value) +{ + fprintf_filtered (file, + _("Whether to always disassemble " + "DWARF expressions is %s.\n"), + value); +} + /* Describe a single location, which may in turn consist of multiple pieces. */ @@ -4570,4 +4582,16 @@ _initialize_dwarf2loc () NULL, show_entry_values_debug, &setdebuglist, &showdebuglist); + + add_setshow_boolean_cmd ("always-disassemble", class_obscure, + &dwarf_always_disassemble, _("\ +Set whether `info address' always disassembles DWARF expressions."), _("\ +Show whether `info address' always disassembles DWARF expressions."), _("\ +When enabled, DWARF expressions are always printed in an assembly-like\n\ +syntax. When disabled, expressions will be printed in a more\n\ +conversational style, when possible."), + NULL, + show_dwarf_always_disassemble, + &set_dwarf_cmdlist, + &show_dwarf_cmdlist); } diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 7c59db56e22..c230778980e 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -25390,18 +25390,6 @@ show_dwarf_cmd (const char *args, int from_tty) cmd_show_list (show_dwarf_cmdlist, from_tty, ""); } -bool dwarf_always_disassemble; - -static void -show_dwarf_always_disassemble (struct ui_file *file, int from_tty, - struct cmd_list_element *c, const char *value) -{ - fprintf_filtered (file, - _("Whether to always disassemble " - "DWARF expressions is %s.\n"), - value); -} - static void show_check_physname (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) @@ -25439,18 +25427,6 @@ caching, which can slow down startup."), &set_dwarf_cmdlist, &show_dwarf_cmdlist); - add_setshow_boolean_cmd ("always-disassemble", class_obscure, - &dwarf_always_disassemble, _("\ -Set whether `info address' always disassembles DWARF expressions."), _("\ -Show whether `info address' always disassembles DWARF expressions."), _("\ -When enabled, DWARF expressions are always printed in an assembly-like\n\ -syntax. When disabled, expressions will be printed in a more\n\ -conversational style, when possible."), - NULL, - show_dwarf_always_disassemble, - &set_dwarf_cmdlist, - &show_dwarf_cmdlist); - add_setshow_zuinteger_cmd ("dwarf-read", no_class, &dwarf_read_debug, _("\ Set debugging of the DWARF reader."), _("\ Show debugging of the DWARF reader."), _("\ diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h index c3a53f65fe7..b9d185d691c 100644 --- a/gdb/dwarf2/read.h +++ b/gdb/dwarf2/read.h @@ -32,8 +32,6 @@ extern struct cmd_list_element *set_dwarf_cmdlist; extern struct cmd_list_element *show_dwarf_cmdlist; -extern bool dwarf_always_disassemble; - struct tu_stats { int nr_uniq_abbrev_tables;