Reorder an "if" in print_disassembly
authorTom Tromey <tom@tromey.com>
Tue, 24 Dec 2019 23:43:51 +0000 (16:43 -0700)
committerTom Tromey <tom@tromey.com>
Fri, 27 Dec 2019 16:33:37 +0000 (09:33 -0700)
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
gdb/cli/cli-cmds.c

index b31ddcd64f0880c0a45e94e400dd8b19eb22b092..571cd787116ac3080fca8b5218d4b876c73a161f 100644 (file)
@@ -1,3 +1,7 @@
+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.
index 681d53c574d88709a72767bf713efac92d092342..e1410690aafa2704ee11b4d6825d8dd13daf6956 100644 (file)
@@ -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.
This page took 0.030023 seconds and 4 git commands to generate.