> 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 :-) > + @subheading The @code{-file-list-exec-source-file} Command > + @findex -file-list-exec-source-file > + > + @subsubheading Synopsis > + > + @smallexample > + -file-list-exec-source-file Can you please expand this to include sample output vis: (gdb) 111-file-list-exec-source-file 111^done,line="23",file="/home/scratch/GDB/src/gdb/testsuite/gdb.mi/basics.c" (gdb) 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. > 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"? > return MI_CMD_DONE; > }