This is the mail archive of the gdb@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]

Re: -inferior-tty-show and -inferior-tty-set


 > I think everywhere that does "if (argc >0)" is broke. I could be wrong
 > about this though. Here is the reason that Andrew asked me to create
 > this function,
 >     http://sourceware.org/ml/gdb-patches/2003-04/msg00030.html

It looks to me that the intention is to make:

-file-list-exec-source-file --

legitimate.  Perhaps we could use the condition"(argc > 0)" for now and worry
about such pathological cases later, when we could also improve mi_getopt to
other things like long options (as Daniel has suggested).

In fact I would like to add an argument to -file-list-exec-source-file to
find the fullname of a file i.e

(gdb)
-file-list-exec-source-file myprint.c
^done,line="16",file="myprint.c",fullname="/home/nick/myprint.c"
(gdb)

where myprog.c is not necessarily the current source file.  At the moment, I
do:

(gdb) 
list myprint.c:1
&"list myprint.c:1\n"
~"1\t/* -*- compile-command: \"cc -g3 -c myprint.c\"; -*-  */\n"
~"2\t\n"
~"3\tint i22;\n"
~"4\t\n"
~"5\tstruct values;\n"
~"6\tstruct values1;\n"
~"7\t\n"
~"8\t#define GOTCHA 9\n"
~"9\t\n"
~"10\tmyprint (int i,int j) {\n"
^done
(gdb) 
-file-list-exec-source-file
^done,line="11",file="myprint.c",fullname="/home/nick/myprint.c"
(gdb) 

to make the file that I'm interested in current first (I'm thinking of a
situation where user the adds to the search path for source files *after* the
start of the debug session).

Nick


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