diff options
Diffstat (limited to 'gdb/stack.c')
-rw-r--r-- | gdb/stack.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/gdb/stack.c b/gdb/stack.c index 405a5e4..e167b6e 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -197,9 +197,11 @@ print_frame_info (struct frame_info *fi, int level, int source, int args) int source_print; int location_print; - if (get_frame_type (fi) == DUMMY_FRAME) + if (get_frame_type (fi) == DUMMY_FRAME + || get_frame_type (fi) == SIGTRAMP_FRAME) { - annotate_frame_begin (level == -1 ? 0 : level, get_frame_pc (fi)); + struct cleanup *uiout_cleanup + = make_cleanup_ui_out_tuple_begin_end (uiout, "frame"); /* Do this regardless of SOURCE because we don't have any source to list for this frame. */ @@ -208,25 +210,27 @@ print_frame_info (struct frame_info *fi, int level, int source, int args) ui_out_text (uiout, "#"); ui_out_field_fmt_int (uiout, 2, ui_left, "level", level); } - annotate_function_call (); - printf_filtered ("<function called from gdb>\n"); - annotate_frame_end (); - return; - } - if ((get_frame_type (fi) == SIGTRAMP_FRAME)) - { - annotate_frame_begin (level == -1 ? 0 : level, get_frame_pc (fi)); - - /* Do this regardless of SOURCE because we don't have any source - to list for this frame. */ - if (level >= 0) + if (ui_out_is_mi_like_p (uiout)) { - ui_out_text (uiout, "#"); - ui_out_field_fmt_int (uiout, 2, ui_left, "level", level); + annotate_frame_address (); + ui_out_field_core_addr (uiout, "addr", fi->pc); + annotate_frame_address_end (); + } + + if (get_frame_type (fi) == DUMMY_FRAME) + { + annotate_function_call (); + ui_out_field_string (uiout, "func", "<function called from gdb>"); + } + else if (get_frame_type (fi) == SIGTRAMP_FRAME) + { + annotate_signal_handler_caller (); + ui_out_field_string (uiout, "func", "<signal handler called>"); } - annotate_signal_handler_caller (); - printf_filtered ("<signal handler called>\n"); + ui_out_text (uiout, "\n"); annotate_frame_end (); + + do_cleanups (uiout_cleanup); return; } |