[FYI,3/3] Reorder an "if" in print_disassembly

Message ID 20191227164228.27948-4-tom@tromey.com
State New
Headers show
Series
  • Minor TUI cleanups
Related show

Commit Message

Tom Tromey Dec. 27, 2019, 4:42 p.m.
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
---
 gdb/ChangeLog      |  4 ++++
 gdb/cli/cli-cmds.c | 10 +++-------
 2 files changed, 7 insertions(+), 7 deletions(-)

-- 
2.17.2

Patch

diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 681d53c574d..e1410690aaf 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.