Remove tui_show_disassem_and_update_source
[deliverable/binutils-gdb.git] / gdb / tui / tui-disasm.c
index 71783266391e2b826aafef6c050e3dbe7a1aa849..94780a56d8a15f8f4eb6f6e82718ca6d695b0c5d 100644 (file)
@@ -47,6 +47,7 @@ struct tui_asm_line
 {
   CORE_ADDR addr;
   std::string addr_string;
+  size_t addr_size;
   std::string insn;
 };
 
@@ -110,6 +111,7 @@ tui_disassemble (struct gdbarch *gdbarch,
          else
            new_size = asm_lines[pos + i].addr_string.size ();
          *addr_size = std::max (*addr_size, new_size);
+         asm_lines[pos + i].addr_size = new_size;
        }
 
       pc = pc + gdb_print_insn (gdbarch, pc, &gdb_dis_out, NULL);
@@ -239,12 +241,11 @@ tui_disasm_window::set_contents (struct gdbarch *arch,
 
       std::string line
        = (asm_lines[i].addr_string
-          + n_spaces (insn_pos
-                      - asm_lines[i].addr_string.size ())
+          + n_spaces (insn_pos - asm_lines[i].addr_size)
           + asm_lines[i].insn);
 
       const char *ptr = line.c_str ();
-      src->line = tui_copy_source_line (&ptr, -1, offset, line_width);
+      src->line = tui_copy_source_line (&ptr, -1, offset, line_width, 0);
 
       src->line_or_addr.loa = LOA_ADDRESS;
       src->line_or_addr.u.addr = asm_lines[i].addr;
@@ -275,36 +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 (symtab_to_fullname (sal.symtab));
-       }
-      else
-       tui_update_locator_fullname ("?");
-    }
-}
-
 void
 tui_get_begin_asm_address (struct gdbarch **gdbarch_p, CORE_ADDR *addr_p)
 {
This page took 0.024211 seconds and 4 git commands to generate.