From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7831 invoked by alias); 31 Mar 2003 18:46:20 -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 7790 invoked from network); 31 Mar 2003 18:46:18 -0000 Received: from unknown (HELO white) (68.14.146.65) by sources.redhat.com with SMTP; 31 Mar 2003 18:46:18 -0000 Received: from bob by white with local (Exim 3.35 #1 (Debian)) id 1904IS-0002la-00; Mon, 31 Mar 2003 13:46:16 -0500 Date: Mon, 31 Mar 2003 18:46:00 -0000 From: Bob Rossi To: Andrew Cagney Cc: gdb-patches@sources.redhat.com Subject: Re: Adding -file-list-exec-source-file command to GDB/MI Message-ID: <20030331184616.GE10233@white> Mail-Followup-To: Andrew Cagney , gdb-patches@sources.redhat.com References: <20030329004109.GA7487@white> <3E87D445.70609@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3E87D445.70609@redhat.com> User-Agent: Mutt/1.3.28i X-SW-Source: 2003-03/txt/msg00610.txt.bz2 On Mon, Mar 31, 2003 at 12:38:13AM -0500, Andrew Cagney wrote: > >This change essentially adds the command -file-list-exec-source-file to > >the mi commands. > > > >* mi-cmd-file.c: Added file to implement mi file commands. > >* mi-cmds.c: Added -file-list-exec-source-file command. > >* mi-cmds.h: Added -file-list-exec-source-file to proto list. > >* doc/gdb.texinfo: Document -file-list-exec-source-file. > > > >* mi-file.exp: Added testcase to test -file-list-exec-source-file. > > I've attached a slightly tweaked version. It was checking for the path > to the executable instead of the source file (separate build / config > directories is the norm) (I'm also not sure what would happen if the > configure contained a relative path but worry about that when someone > notices :-) I am noticing this now. The variable set abs_srcfile [string_to_regexp ${srcdir}/${subdir}/${srcfile}] has the value ("\./gdb\.mi/basics\.c") when I run the testcase. This is why I made it check for the path to the executable in the first place. What do you think we should do here? I have no idea. > Rather than file=..., should the field be called something like > fullname=...., realpath= or fullpath=? That way, the same term can be > used consistently through out MI. I like fullname because it is used already in symtab.h /* Full name of file as found by searching the source path. NULL if not yet known. */ char *fullname; > > >enum mi_cmd_result > >mi_cmd_file_list_exec_source_file(char *command, char **argv, int argc) > >{ > > struct symtab_and_line st; > > See: > http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=783 > > Even though there are no arguments it will want to discard any "--". A > mi_getopt() call to strip off any leading "--". I think you'll want to > tweak that function so that calling it is easier - allow NULL OPT and > OPTARG? > > > /* Print to the user the line and absolute file name */ > > ui_out_field_int (uiout, "line", st.line); > > ui_out_field_string (uiout, "file", st.symtab->fullname); > > Following on from above, should it print both "file" and "fullname"? Yes, defiantly.