public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tom Tromey <tromey@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] Move dwarf_always_disassemble to dwarf2/loc.c
Date: Sat, 08 Feb 2020 20:56:00 -0000	[thread overview]
Message-ID: <20200208205642.85334.qmail@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=009b64fc98a3bad39d19bbdca83a223dce3d87d4

commit 009b64fc98a3bad39d19bbdca83a223dce3d87d4
Author: Tom Tromey <tom@tromey.com>
Date:   Sat Feb 8 13:40:54 2020 -0700

    Move dwarf_always_disassemble to dwarf2/loc.c
    
    dwarf_always_disassemble is only used in dwarf2/loc.c, so move the
    definition and the command infrastructure to that file.
    
    2020-02-08  Tom Tromey  <tom@tromey.com>
    
    	* 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

Diff:
---
 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/ChangeLog b/gdb/ChangeLog
index 5f51d56..07481ad 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,17 @@
 2020-02-08  Tom Tromey  <tom@tromey.com>
 
+	* 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.
+
+2020-02-08  Tom Tromey  <tom@tromey.com>
+
 	* dwarf2/read.c (~dwarf2_per_objfile): Update.
 	(create_quick_file_names_table): Return htab_up.
 	(dw2_get_file_names_reader, dw2_forget_cached_source_info):
diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c
index 0333360..e337a02 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 6e893ba..9cda828 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -25345,18 +25345,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)
@@ -25394,18 +25382,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 138a929..fdaafbb 100644
--- a/gdb/dwarf2/read.h
+++ b/gdb/dwarf2/read.h
@@ -33,8 +33,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;


                 reply	other threads:[~2020-02-08 20:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20200208205642.85334.qmail@sourceware.org \
    --to=tromey@sourceware.org \
    --cc=gdb-cvs@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).