2002-11-08 Jason Molenda (jmolenda@apple.com) * stack.c (print_frame_info_base): Emit full FRAME tuple for gdb call dummy and signal handler synthetic stack frames; send stack frame name through UI instead of stdout. Index: stack.c =================================================================== RCS file: /cvs/src/src/gdb/stack.c,v retrieving revision 1.46 diff -u -p -r1.46 stack.c --- stack.c 3 Oct 2002 22:34:58 -0000 1.46 +++ stack.c 8 Nov 2002 22:02:49 -0000 @@ -332,28 +332,12 @@ print_frame_info_base (struct frame_info struct symtab_and_line sal; int source_print; int location_print; + struct cleanup *uiout_cleanup; -#if 0 - char buf[MAX_REGISTER_RAW_SIZE]; - CORE_ADDR sp; - - /* On the 68k, this spends too much time in m68k_find_saved_regs. */ - - /* Get the value of SP_REGNUM relative to the frame. */ - get_saved_register (buf, (int *) NULL, (CORE_ADDR *) NULL, - FRAME_INFO_ID (fi), SP_REGNUM, (enum lval_type *) NULL); - sp = extract_address (buf, REGISTER_RAW_SIZE (SP_REGNUM)); - - /* This is not a perfect test, because if a function alloca's some - memory, puts some code there, and then jumps into it, then the test - will succeed even though there is no call dummy. Probably best is - to check for a bp_call_dummy breakpoint. */ - if (PC_IN_CALL_DUMMY (fi->pc, sp, fi->frame)) -#else - if (frame_in_dummy (fi)) -#endif + if (frame_in_dummy (fi) || fi->signal_handler_caller) { annotate_frame_begin (level == -1 ? 0 : level, fi->pc); + 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. */ @@ -362,25 +346,29 @@ print_frame_info_base (struct frame_info ui_out_text (uiout, "#"); ui_out_field_fmt_int (uiout, 2, ui_left, "level", level); } + if (ui_out_is_mi_like_p (uiout)) + { + annotate_frame_address (); + ui_out_field_core_addr (uiout, "addr", fi->pc); + annotate_frame_address_end (); + } + } + if (frame_in_dummy (fi)) + { annotate_function_call (); - printf_filtered ("\n"); + ui_out_field_string (uiout, "func", ""); + ui_out_text (uiout, "\n"); annotate_frame_end (); + do_cleanups (uiout_cleanup); return; } if (fi->signal_handler_caller) { - annotate_frame_begin (level == -1 ? 0 : level, fi->pc); - - /* Do this regardless of SOURCE because we don't have any source - to list for this frame. */ - if (level >= 0) - { - ui_out_text (uiout, "#"); - ui_out_field_fmt_int (uiout, 2, ui_left, "level", level); - } annotate_signal_handler_caller (); - printf_filtered ("\n"); + ui_out_field_string (uiout, "func", ""); + ui_out_text (uiout, "\n"); annotate_frame_end (); + do_cleanups (uiout_cleanup); return; }