From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20896 invoked by alias); 23 Mar 2005 22:34:35 -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 20674 invoked from network); 23 Mar 2005 22:34:20 -0000 Received: from unknown (HELO lakermmtao05.cox.net) (68.230.240.34) by sourceware.org with SMTP; 23 Mar 2005 22:34:20 -0000 Received: from white ([68.9.64.121]) by lakermmtao05.cox.net (InterMail vM.6.01.04.00 201-2131-118-20041027) with ESMTP id <20050323223420.LNBP3789.lakermmtao05.cox.net@white>; Wed, 23 Mar 2005 17:34:20 -0500 Received: from bob by white with local (Exim 3.35 #1 (Debian)) id 1DEEQh-0002N2-00; Wed, 23 Mar 2005 17:34:23 -0500 Date: Wed, 23 Mar 2005 22:34:00 -0000 From: Bob Rossi To: Dennis Brueni Cc: gdb-patches@sources.redhat.com Subject: Re: [RFC] fullname attribute for GDB/MI stack frames Message-ID: <20050323223423.GB8757@white> Mail-Followup-To: Dennis Brueni , gdb-patches@sources.redhat.com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i X-SW-Source: 2005-03/txt/msg00292.txt.bz2 > 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