* tui.c (tuiGetLowDisassemblyAddress): Moved from here.
authorStephane Carrez <stcarrez@nerim.fr>
Wed, 28 Aug 2002 20:33:27 +0000 (20:33 +0000)
committerStephane Carrez <stcarrez@nerim.fr>
Wed, 28 Aug 2002 20:33:27 +0000 (20:33 +0000)
* tuiDisassem.c (tuiGetLowDisassemblyAddress): To here, and use
tui_find_disassembly_address to find the starting address of
disassemble window.

gdb/tui/ChangeLog
gdb/tui/tui.c
gdb/tui/tuiDisassem.c

index be156d2a93684ee79770ce1b2a7bdc137deb14de..0e19a122e12b9901333197fbf2aa42cc0f2aabe1 100644 (file)
@@ -1,3 +1,10 @@
+2002-08-29  Stephane Carrez  <stcarrez@nerim.fr>
+
+       * tui.c (tuiGetLowDisassemblyAddress): Moved from here.
+       * tuiDisassem.c (tuiGetLowDisassemblyAddress): To here, and use
+       tui_find_disassembly_address to find the starting address of
+       disassemble window.
+
 2002-08-28  Stephane Carrez  <stcarrez@nerim.fr>
 
        * tuiDisassem.c (tui_disassemble): New function to disassemble
index 2b9ccae8c980fd3572bfd44891bfb6fc1caa094c..ab2c201fba6fae0d59de06e76f3885f5abe0b5fb 100644 (file)
@@ -311,31 +311,6 @@ tuiFree (char *ptr)
     }
 }
 
-/* Determine what the low address will be to display in the TUI's
-   disassembly window.  This may or may not be the same as the
-   low address input.  */
-CORE_ADDR
-tuiGetLowDisassemblyAddress (CORE_ADDR low, CORE_ADDR pc)
-{
-  int line;
-  CORE_ADDR newLow;
-
-  /* Determine where to start the disassembly so that the pc is about in the
-     middle of the viewport.  */
-  for (line = 0, newLow = pc;
-       (newLow > low &&
-       line < (tuiDefaultWinViewportHeight (DISASSEM_WIN,
-                                            DISASSEM_COMMAND) / 2));)
-    {
-      bfd_byte buffer[4];
-
-      newLow -= sizeof (bfd_getb32 (buffer));
-      line++;
-    }
-
-  return newLow;
-}
-
 void
 strcat_to_buf (char *buf, int buflen, const char *itemToAdd)
 {
index 719a26b40b1f794f3f7a3540b291f9ca71a24502..50a6d0ef9f7b811d9a82a0c97d5a41a8322b0ad0 100644 (file)
@@ -382,6 +382,24 @@ tuiGetBeginAsmAddress (void)
   return addr;
 }                              /* tuiGetBeginAsmAddress */
 
+/* Determine what the low address will be to display in the TUI's
+   disassembly window.  This may or may not be the same as the
+   low address input.  */
+CORE_ADDR
+tuiGetLowDisassemblyAddress (CORE_ADDR low, CORE_ADDR pc)
+{
+  int pos;
+
+  /* Determine where to start the disassembly so that the pc is about in the
+     middle of the viewport.  */
+  pos = tuiDefaultWinViewportHeight (DISASSEM_WIN, DISASSEM_COMMAND) / 2;
+  pc = tui_find_disassembly_address (pc, -pos);
+
+  if (pc < low)
+    pc = low;
+  return pc;
+}
+
 /*
    ** tuiVerticalDisassemScroll().
    **      Scroll the disassembly forward or backward vertically
This page took 0.026383 seconds and 4 git commands to generate.