This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] fullname attribute for GDB/MI stack frames


> The following patch fixes the code that reports stack frames
> to append a "fullname" attribute to each stack frame, reporting
> the absolute path name of the source file.  This effects MI output
> mode only and does not hurt performance.
> 
> Index: gdb/stack.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/stack.c,v
> 
> $ diff -c -p -b stack.c-6.3 stack.c
> *** stack.c-6.3 Wed Mar 23 17:03:57 2005
> --- stack.c     Wed Mar 23 15:40:11 2005
> *************** print_frame (struct frame_info *fi,
> *** 666,671 ****
> --- 666,679 ----
>         ui_out_text (uiout, " at ");
>         annotate_frame_source_file ();
>         ui_out_field_string (uiout, "file", sal.symtab->filename);
> +       if (ui_out_is_mi_like_p(uiout)) {
> +          if (!sal.symtab->fullname) {
> +             source_full_path_of(sal.symtab->filename,
> &sal.symtab->fullname);
> +          }
> +          if (sal.symtab->fullname) {
> +             ui_out_field_string (uiout, "fullname",
> sal.symtab->fullname);
> +          }
> +       }
>         annotate_frame_source_file_end ();
>         ui_out_text (uiout, ":");
>         annotate_frame_source_line ();

This is great, I've was eventually going to get to this. Although I'm
not the maintainer, I have a few comments,

You should probably be using symtab_to_fullname instead of
source_full_path_of. In fact, maybe source_full_path_of should be
deprecated. symtab_to_fullname is used in mi/mi-cmd-file.c.

Also, there should be a corresponding testcase, that ensures the new 
field is working properly.

Thanks,
Bob Rossi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]