public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Reorder an "if" in print_disassembly
@ 2019-12-27 16:42 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2019-12-27 16:42 UTC (permalink / raw)
  To: gdb-cvs

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

commit f9ba974dea317eae6e7032b52b52314cbe43f9d8
Author: Tom Tromey <tom@tromey.com>
Date:   Tue Dec 24 16:43:51 2019 -0700

    Reorder an "if" in print_disassembly
    
    I noticed that print_disassembly has two #if blocks for TUI code,
    where one would do.  This patch rearranges the code slightly to remove
    a #if.
    
    gdb/ChangeLog
    2019-12-27  Tom Tromey  <tom@tromey.com>
    
    	* cli/cli-cmds.c (print_disassembly): Reorder "if".
    
    Change-Id: I36f3f682f5685b3d9b148da5aed26eb3cc7d598e

Diff:
---
 gdb/ChangeLog      |  4 ++++
 gdb/cli/cli-cmds.c | 10 +++-------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b31ddcd..571cd78 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
 2019-12-27  Tom Tromey  <tom@tromey.com>
 
+	* cli/cli-cmds.c (print_disassembly): Reorder "if".
+
+2019-12-27  Tom Tromey  <tom@tromey.com>
+
 	* tui/tui.c (tui_active): Now bool.
 	(tui_finish_init): Likewise.
 	(tui_enable): Update.
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 681d53c..e141069 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -1338,7 +1338,9 @@ print_disassembly (struct gdbarch *gdbarch, const char *name,
 		   gdb_disassembly_flags flags)
 {
 #if defined(TUI)
-  if (!tui_is_window_visible (DISASSEM_WIN))
+  if (tui_is_window_visible (DISASSEM_WIN))
+    tui_show_assembly (gdbarch, low);
+  else
 #endif
     {
       printf_filtered ("Dump of assembler code ");
@@ -1368,12 +1370,6 @@ print_disassembly (struct gdbarch *gdbarch, const char *name,
 	}
       printf_filtered ("End of assembler dump.\n");
     }
-#if defined(TUI)
-  else
-    {
-      tui_show_assembly (gdbarch, low);
-    }
-#endif
 }
 
 /* Subroutine of disassemble_command to simplify it.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-12-27 16:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-27 16:42 [binutils-gdb] Reorder an "if" in print_disassembly Tom Tromey

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).