aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2011-03-18 18:50:20 +0000
committerPedro Alves <palves@redhat.com>2011-03-18 18:50:20 +0000
commitf23d1b929daf1f1513c63ac810f05db9b1492c10 (patch)
treeff258d97f2322f574fcd58fd29dfb9f0d1bcdad2 /gdb
parent1d4f574102b243b00dead2f2ed9493c812cc07c9 (diff)
downloadgdb-f23d1b929daf1f1513c63ac810f05db9b1492c10.zip
gdb-f23d1b929daf1f1513c63ac810f05db9b1492c10.tar.gz
gdb-f23d1b929daf1f1513c63ac810f05db9b1492c10.tar.bz2
gdb/
* tui/tui-hooks.c (tui_selected_frame_level_changed_hook): Assume there's always a frame. Use get_frame_pc_if_available instead of get_frame_pc, and if there's no PC available, don't look up a symtab.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/tui/tui-hooks.c38
2 files changed, 27 insertions, 18 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7fb0510..0dbc501 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
2011-03-18 Pedro Alves <pedro@codesourcery.com>
+ * tui/tui-hooks.c (tui_selected_frame_level_changed_hook): Assume
+ there's always a frame. Use get_frame_pc_if_available instead of
+ get_frame_pc, and if there's no PC available, don't look up a
+ symtab.
+
+2011-03-18 Pedro Alves <pedro@codesourcery.com>
+
* stack.c (print_frame_local_vars, print_frame_arg_vars): Handle
unavailable PC.
diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c
index e132b5a..97b99a7 100644
--- a/gdb/tui/tui-hooks.c
+++ b/gdb/tui/tui-hooks.c
@@ -190,6 +190,7 @@ static void
tui_selected_frame_level_changed_hook (int level)
{
struct frame_info *fi;
+ CORE_ADDR pc;
/* Negative level means that the selected frame was cleared. */
if (level < 0)
@@ -199,28 +200,29 @@ tui_selected_frame_level_changed_hook (int level)
/* Ensure that symbols for this frame are read in. Also, determine
the source language of this frame, and switch to it if
desired. */
- if (fi)
+ if (get_frame_pc_if_available (fi, &pc))
{
struct symtab *s;
-
- s = find_pc_symtab (get_frame_pc (fi));
+
+ s = find_pc_symtab (pc);
/* elz: This if here fixes the problem with the pc not being
- displayed in the tui asm layout, with no debug symbols. The
- value of s would be 0 here, and select_source_symtab would
- abort the command by calling the 'error' function. */
+ displayed in the tui asm layout, with no debug symbols. The
+ value of s would be 0 here, and select_source_symtab would
+ abort the command by calling the 'error' function. */
if (s)
- select_source_symtab (s);
-
- /* Display the frame position (even if there is no symbols). */
- tui_show_frame_info (fi);
-
- /* Refresh the register window if it's visible. */
- if (tui_is_window_visible (DATA_WIN))
- {
- tui_refreshing_registers = 1;
- tui_check_data_values (fi);
- tui_refreshing_registers = 0;
- }
+ select_source_symtab (s);
+ }
+
+ /* Display the frame position (even if there is no symbols or the PC
+ is not known). */
+ tui_show_frame_info (fi);
+
+ /* Refresh the register window if it's visible. */
+ if (tui_is_window_visible (DATA_WIN))
+ {
+ tui_refreshing_registers = 1;
+ tui_check_data_values (fi);
+ tui_refreshing_registers = 0;
}
}