Remove tui_show_disassem_and_update_source
authorTom Tromey <tom@tromey.com>
Wed, 6 Nov 2019 23:09:28 +0000 (16:09 -0700)
committerTom Tromey <tom@tromey.com>
Fri, 20 Dec 2019 16:15:49 +0000 (09:15 -0700)
tui_show_disassem_and_update_source only has a single caller.  This
patch simplifies that caller, by having it call tui_show_disassem, and
then removes tui_show_disassem_and_update_source.

gdb/ChangeLog
2019-12-20  Tom Tromey  <tom@tromey.com>

* tui/tui-winsource.c (tui_update_source_windows_with_addr): Call
tui_show_disassem.
* tui/tui-disasm.h (tui_show_disassem_and_update_source): Don't
declare.
* tui/tui-disasm.c (tui_show_disassem_and_update_source): Remove.

Change-Id: I7554eca8e259f3539ea7710f2ff369b4a630dd9d

gdb/ChangeLog
gdb/tui/tui-disasm.c
gdb/tui/tui-disasm.h
gdb/tui/tui-winsource.c

index 3815b5979362a76fdee89e4f1baf56c2bf011acc..7c518ca7bb95a978499ee1c91c5666f2b3c83a17 100644 (file)
@@ -1,3 +1,11 @@
+2019-12-20  Tom Tromey  <tom@tromey.com>
+
+       * tui/tui-winsource.c (tui_update_source_windows_with_addr): Call
+       tui_show_disassem.
+       * tui/tui-disasm.h (tui_show_disassem_and_update_source): Don't
+       declare.
+       * tui/tui-disasm.c (tui_show_disassem_and_update_source): Remove.
+
 2019-12-20  Tom Tromey  <tom@tromey.com>
 
        * tui/tui.h (tui_show_source): Remove parameters.
index 18e281e27566419e4e0aa9e0fe580e1c8406cf7a..94780a56d8a15f8f4eb6f6e82718ca6d695b0c5d 100644 (file)
@@ -276,32 +276,6 @@ tui_show_disassem (struct gdbarch *gdbarch, CORE_ADDR start_addr)
     tui_set_win_focus_to (TUI_DISASM_WIN);
 }
 
-
-/* Function to display the disassembly window.  */
-void
-tui_show_disassem_and_update_source (struct gdbarch *gdbarch,
-                                    CORE_ADDR start_addr)
-{
-  struct symtab_and_line sal;
-
-  tui_show_disassem (gdbarch, start_addr);
-  if (tui_current_layout () == SRC_DISASSEM_COMMAND)
-    {
-      struct tui_line_or_address val;
-
-      /* Update what is in the source window if it is displayed too,
-         note that it follows what is in the disassembly window and
-         visa-versa.  */
-      sal = find_pc_line (start_addr, 0);
-      val.loa = LOA_LINE;
-      val.u.line_no = sal.line;
-      TUI_SRC_WIN->update_source_window (gdbarch, sal.symtab, val);
-      if (sal.symtab)
-       set_current_source_symtab_and_line (sal);
-      tui_update_locator_fullname (sal.symtab);
-    }
-}
-
 void
 tui_get_begin_asm_address (struct gdbarch **gdbarch_p, CORE_ADDR *addr_p)
 {
index bfddfa0183795831fda5db0681a6b3a177d915d9..a4b04e4ddd59046162301e2fef1411805f904790 100644 (file)
@@ -69,7 +69,6 @@ private:
 };
 
 extern void tui_show_disassem (struct gdbarch *, CORE_ADDR);
-extern void tui_show_disassem_and_update_source (struct gdbarch *, CORE_ADDR);
 extern void tui_get_begin_asm_address (struct gdbarch **, CORE_ADDR *);
 
 #endif /* TUI_TUI_DISASM_H */
index 938a0af312887d559dd6a3015d83424ab9bfc749..06c00fa2b8087b4c7027071b699ed936a77c18aa 100644 (file)
@@ -221,21 +221,15 @@ tui_update_source_windows_with_addr (struct gdbarch *gdbarch, CORE_ADDR addr)
       struct symtab_and_line sal;
       struct tui_line_or_address l;
       
-      switch (tui_current_layout ())
+      if (TUI_DISASM_WIN != nullptr)
+       tui_show_disassem (gdbarch, addr);
+
+      if (TUI_SRC_WIN != nullptr)
        {
-       case DISASSEM_COMMAND:
-       case DISASSEM_DATA_COMMAND:
-         tui_show_disassem (gdbarch, addr);
-         break;
-       case SRC_DISASSEM_COMMAND:
-         tui_show_disassem_and_update_source (gdbarch, addr);
-         break;
-       default:
          sal = find_pc_line (addr, 0);
          l.loa = LOA_LINE;
          l.u.line_no = sal.line;
          TUI_SRC_WIN->show_symtab_source (gdbarch, sal.symtab, l);
-         break;
        }
     }
   else
This page took 0.033401 seconds and 4 git commands to generate.