From e3eebbd742b7c1820bead11710b71bfee694d7fa Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Fri, 18 Mar 2011 18:44:34 +0000 Subject: gdb/ * frame.c (frame_unwind_pc): Rename to ... (frame_unwind_pc_if_available): ... this. New `pc' output parameter. Change return type to int. Gracefully handle gdbarch_unwind_pc throwing NOT_AVAILABLE_ERROR. Return 0 if that happened, or 1 otherwise. (frame_unwind_pc): Reimplement on top of frame_unwind_pc_if_available. (get_frame_func): Rename to ... (get_frame_func_if_available): New `pc' output parameter. Change return type to int. Gracefully handle the PC not being available. (get_frame_func): Reimplement on top of get_frame_func_if_available. (select_frame): Handle the PC being unavailable. (get_prev_frame): Handle the PC being unavailable. (get_frame_pc_if_available): New. (get_frame_address_in_block_if_available): New. (find_frame_sal): Handle the frame PC not being available. * frame.h (get_frame_pc_if_available): Declare. (get_frame_address_in_block_if_available): Declare. (get_frame_func_if_available): Declare. * stack.c (print_frame_info): Handle the PC being unavailable. (find_frame_funname): Ditto. (print_frame): Handle the PC being unavailable. (get_frame_language): Ditto. * blockframe.c (get_frame_block): Ditto. * macroscope.c (default_macro_scope): Ditto. * tui/tui-stack.c (tui_show_frame_info): Ditto. --- gdb/tui/tui-stack.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'gdb/tui/tui-stack.c') diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c index f618d7c..0068610 100644 --- a/gdb/tui/tui-stack.c +++ b/gdb/tui/tui-stack.c @@ -342,16 +342,23 @@ tui_show_frame_info (struct frame_info *fi) struct tui_gen_win_info *locator = tui_locator_win_info_ptr (); int source_already_displayed; struct symtab_and_line sal; + CORE_ADDR pc; find_frame_sal (fi, &sal); source_already_displayed = sal.symtab != 0 && tui_source_is_displayed (sal.symtab->filename); - tui_set_locator_info (get_frame_arch (fi), - sal.symtab == 0 ? "??" : sal.symtab->filename, - tui_get_function_from_frame (fi), - sal.line, - get_frame_pc (fi)); + + if (get_frame_pc_if_available (fi, &pc)) + tui_set_locator_info (get_frame_arch (fi), + sal.symtab == 0 ? "??" : sal.symtab->filename, + tui_get_function_from_frame (fi), + sal.line, + pc); + else + tui_set_locator_info (get_frame_arch (fi), + "??", _(""), sal.line, 0); + tui_show_locator_content (); start_line = 0; for (i = 0; i < (tui_source_windows ())->count; i++) -- cgit v1.1