Index: defs.h =================================================================== RCS file: /cvs/src/src/gdb/defs.h,v retrieving revision 1.112 diff -c -w -p -r1.112 defs.h *** defs.h 4 Feb 2003 18:07:00 -0000 1.112 --- defs.h 7 Feb 2003 17:52:51 -0000 *************** extern void (*show_load_progress) (const *** 1166,1171 **** --- 1166,1174 ---- extern void (*print_frame_info_listing_hook) (struct symtab * s, int line, int stopline, int noerror); + extern void (*print_frame_more_info_hook) (struct ui_out *uiout, + struct symtab_and_line *sal, + struct frame_info *fi); extern struct frame_info *parse_frame_specification (char *frame_exp); extern int (*query_hook) (const char *, va_list); extern void (*warning_hook) (const char *, va_list); Index: stack.c =================================================================== RCS file: /cvs/src/src/gdb/stack.c,v retrieving revision 1.65 diff -c -w -p -r1.65 stack.c *** stack.c 2 Feb 2003 18:30:56 -0000 1.65 --- stack.c 7 Feb 2003 17:52:51 -0000 *************** print_frame (struct frame_info *fi, *** 452,457 **** --- 452,460 ---- annotate_frame_source_end (); } + if (print_frame_more_info_hook) + print_frame_more_info_hook (uiout, &sal, fi); + #ifdef PC_SOLIB if (!funname || (!sal.symtab || !sal.symtab->filename)) { Index: top.c =================================================================== RCS file: /cvs/src/src/gdb/top.c,v retrieving revision 1.71 diff -c -w -p -r1.71 top.c *** top.c 6 Feb 2003 01:19:12 -0000 1.71 --- top.c 7 Feb 2003 17:52:52 -0000 *************** void (*command_loop_hook) (void); *** 206,211 **** --- 206,216 ---- void (*print_frame_info_listing_hook) (struct symtab * s, int line, int stopline, int noerror); + + void (*print_frame_more_info_hook) (struct ui_out *uiout, + struct symtab_and_line *sal, + struct frame_info *fi); + /* Replaces most of query. */ int (*query_hook) (const char *, va_list); Index: mi/mi-cmd-stack.c =================================================================== RCS file: /cvs/src/src/gdb/mi/mi-cmd-stack.c,v retrieving revision 1.13 diff -c -w -p -r1.13 mi-cmd-stack.c *** mi/mi-cmd-stack.c 29 Nov 2002 19:15:16 -0000 1.13 --- mi/mi-cmd-stack.c 7 Feb 2003 17:52:52 -0000 *************** *** 32,37 **** --- 32,44 ---- we pull the plug on the sanitization. */ extern void select_frame_command_wrapper (char *, int); + /* Use this to print any extra info in the stack listing output that is + not in the standard gdb printing */ + + void mi_print_frame_more_info (struct ui_out *uiout, + struct symtab_and_line *sal, + struct frame_info *fi); + static void list_args_or_locals (int locals, int values, struct frame_info *fi); /* Print a list of the stack frames. Args can be none, in which case *************** mi_cmd_stack_list_frames (char *command, *** 101,106 **** --- 108,127 ---- error ("mi_cmd_stack_list_frames: Not enough frames in stack."); return MI_CMD_DONE; + } + + void + mi_print_frame_more_info (struct ui_out *uiout, + struct symtab_and_line *sal, + struct frame_info *fi) + { + /* I would feel happier if we used ui_out_field_skip for all the fields + that we don't know how to set (like the file if we don't have symbols) + but the rest of print_frame just omits the fields if they are not known, + so I will do the same here... */ + + if (sal && sal->symtab && sal->symtab->dirname) + ui_out_field_string (uiout, "dir", sal->symtab->dirname); } enum mi_cmd_result Index: mi/mi-interp.c =================================================================== RCS file: /cvs/src/src/gdb/mi/mi-interp.c,v retrieving revision 1.2 diff -c -w -p -r1.2 mi-interp.c *** mi/mi-interp.c 6 Feb 2003 05:30:17 -0000 1.2 --- mi/mi-interp.c 7 Feb 2003 17:52:52 -0000 *************** static int mi_interp_query_hook (const c *** 60,65 **** --- 60,70 ---- static char *mi_interp_read_one_line_hook (char *prompt, int repeat, char *anno); + /* There should be a generic mi .h file where these should go... */ + extern void mi_print_frame_more_info (struct ui_out *uiout, + struct symtab_and_line *sal, + struct frame_info *fi); + static void mi2_command_loop (void); static void mi1_command_loop (void); *************** mi_interpreter_resume (void *data) *** 129,134 **** --- 134,140 ---- clear_interpreter_hooks (); show_load_progress = mi_load_progress; + print_frame_more_info_hook = mi_print_frame_more_info; /* If we're _the_ interpreter, take control. */ if (current_interp_named_p (INTERP_MI1))