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]

[RFC] fullname attribute for GDB/MI stack frames


Using the GDB/MI interface, there is no direct way to get the
absolute path name of a source file referenced in a stack frame.
All that is reported is the relative path of the source file.
This makes it tedious to locate the correct source file and
and especially difficult in the case where source files in
different directories share the same file name.

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.

--Dennis Brueni
  dennis@slickedit.com


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 ();


------------------------
Dennis Brueni
Software Engineer
SlickEdit Inc.
3000 Aerial Center Pkwy, Suite 120
Morrisville, NC  27560
919.473.0132
Fax:  919.473.0080
http://www.slickedit.com
------------------------    	


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