summaryrefslogtreecommitdiff
path: root/gdb/tui
diff options
context:
space:
mode:
authorStephane Carrez <stcarrez@nerim.fr>2002-08-28 20:33:27 +0000
committerStephane Carrez <stcarrez@nerim.fr>2002-08-28 20:33:27 +0000
commitd35dad45d4a1b07383bc870ef3be2233aa866149 (patch)
tree8f80f61b0c74ea3a2e879685d5702062820b2312 /gdb/tui
parentafac9757020aefb94f40aeadfe3eab205d029238 (diff)
downloadgdb-d35dad45d4a1b07383bc870ef3be2233aa866149.tar.gz
* 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.
Diffstat (limited to 'gdb/tui')
-rw-r--r--gdb/tui/ChangeLog7
-rw-r--r--gdb/tui/tui.c25
-rw-r--r--gdb/tui/tuiDisassem.c18
3 files changed, 25 insertions, 25 deletions
diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog
index be156d2a936..0e19a122e12 100644
--- a/gdb/tui/ChangeLog
+++ b/gdb/tui/ChangeLog
@@ -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
diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
index 2b9ccae8c98..ab2c201fba6 100644
--- a/gdb/tui/tui.c
+++ b/gdb/tui/tui.c
@@ -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)
{
diff --git a/gdb/tui/tuiDisassem.c b/gdb/tui/tuiDisassem.c
index 719a26b40b1..50a6d0ef9f7 100644
--- a/gdb/tui/tuiDisassem.c
+++ b/gdb/tui/tuiDisassem.c
@@ -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