aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2009-01-18 21:28:39 +0000
committerPedro Alves <palves@redhat.com>2009-01-18 21:28:39 +0000
commitaefc706471ace00a164b5a65717d5a0932d2eaf0 (patch)
tree74d4899e33a523638b1a8c190edad5d1687f7462 /gdb
parent29f49a6a4f3f165090de6c85fdb0f29dcb579ae7 (diff)
downloadgdb-aefc706471ace00a164b5a65717d5a0932d2eaf0.zip
gdb-aefc706471ace00a164b5a65717d5a0932d2eaf0.tar.gz
gdb-aefc706471ace00a164b5a65717d5a0932d2eaf0.tar.bz2
* tui/tui-disasm.c (tui_vertical_disassem_scroll): Scroll one line
at a time, times NUM_TO_SCROLL. * tui/tui-winsource.c (tui_horizontal_source_scroll): Don't try to fetch the selected frame if there is no stack.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/tui/tui-disasm.c15
-rw-r--r--gdb/tui/tui-winsource.c15
3 files changed, 20 insertions, 17 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 79d3ed7..cbd3dad 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
2009-01-18 Pedro Alves <pedro@codesourcery.com>
+ * tui/tui-disasm.c (tui_vertical_disassem_scroll): Scroll one line
+ at a time, times NUM_TO_SCROLL.
+ * tui/tui-winsource.c (tui_horizontal_source_scroll): Don't try to
+ fetch the selected frame if there is no stack.
+
+2009-01-18 Pedro Alves <pedro@codesourcery.com>
+
PR gdb/9747:
* gdbthread.h (finish_thread_state, finish_thread_state_cleanup):
Declare.
diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c
index 9c4f9d5..c079087 100644
--- a/gdb/tui/tui-disasm.c
+++ b/gdb/tui/tui-disasm.c
@@ -379,24 +379,17 @@ tui_vertical_disassem_scroll (enum tui_scroll_direction scroll_direction,
{
CORE_ADDR pc;
tui_win_content content;
- struct symtab *s;
struct tui_line_or_address val;
- int max_lines, dir;
- struct symtab_and_line cursal = get_current_source_symtab_and_line ();
+ int dir;
content = (tui_win_content) TUI_DISASM_WIN->generic.content;
- if (cursal.symtab == (struct symtab *) NULL)
- s = find_pc_symtab (get_frame_pc (get_selected_frame (NULL)));
- else
- s = cursal.symtab;
- /* Account for hilite. */
- max_lines = TUI_DISASM_WIN->generic.height - 2;
pc = content[0]->which_element.source.line_or_addr.u.addr;
- dir = (scroll_direction == FORWARD_SCROLL) ? max_lines : - max_lines;
+ num_to_scroll++;
+ dir = (scroll_direction == FORWARD_SCROLL) ? num_to_scroll : -num_to_scroll;
val.loa = LOA_ADDRESS;
val.u.addr = tui_find_disassembly_address (pc, dir);
- tui_update_source_window_as_is (TUI_DISASM_WIN, s, val, FALSE);
+ tui_update_source_window_as_is (TUI_DISASM_WIN, NULL, val, FALSE);
}
}
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index b93c2c9..158aa89 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -312,13 +312,16 @@ tui_horizontal_source_scroll (struct tui_win_info *win_info,
if (win_info->generic.content != NULL)
{
int offset;
- struct symtab *s;
- struct symtab_and_line cursal = get_current_source_symtab_and_line ();
+ struct symtab *s = NULL;
- if (cursal.symtab == (struct symtab *) NULL)
- s = find_pc_symtab (get_frame_pc (get_selected_frame (NULL)));
- else
- s = cursal.symtab;
+ if (win_info->generic.type == SRC_WIN)
+ {
+ struct symtab_and_line cursal = get_current_source_symtab_and_line ();
+ if (cursal.symtab == NULL)
+ s = find_pc_symtab (get_frame_pc (get_selected_frame (NULL)));
+ else
+ s = cursal.symtab;
+ }
if (direction == LEFT_SCROLL)
offset = win_info->detail.source_info.horizontal_offset + num_to_scroll;