From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6818 invoked by alias); 23 Mar 2005 22:22:22 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 6399 invoked from network); 23 Mar 2005 22:22:11 -0000 Received: from unknown (HELO wampa.office.slickedit.com) (65.210.24.21) by sourceware.org with SMTP; 23 Mar 2005 22:22:11 -0000 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: [RFC] fullname attribute for GDB/MI stack frames Date: Wed, 23 Mar 2005 22:22:00 -0000 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: From: "Dennis Brueni" To: Cc: "Dennis Brueni" X-SW-Source: 2005-03/txt/msg00291.txt.bz2 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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 ------------------------=20=20=20=20=09