MI: -file-list-exec-source-files
Nick Roberts
nickrob@snap.net.nz
Sat Jun 3 01:28:00 GMT 2006
> Perhaps, but in working on the UI for other debuggers, I have seen this and
> it looked like the same situation. When I worked on Compaq ladebug, we had
> to get the list of source files so that the user could choose one to set
> bpts in, or to browse. In retrieving that list from the debugger, I saw e
> xactly what Nick is seeing. And in delving into the internals of the
> debugger/compiler, I found that the situation I described, with foo.? to
> be why I saw more than one source. This is especially true for C++ when
> templates are used. What you really want to see in a list like this is
> "foo.c compiled this way", "foo.c compiled that way", and so on. I don't
> think any debugger has solved this problem reasonably from a UI perspective.
I think it's always best to start with the simplest case:
mytest.c:
main ()
{
myproc ();
}
myproc.c:
myproc ()
{
return 0;
}
With gcc (GCC) 4.1.0 20060304 (Red Hat 4.1.0-3)
cc -g -c myproc.c
cc -g -o mytest mytest.c myproc.o
With GNU gdb 6.5.50.20060601-cvs, I get:
(gdb)
-file-list-exec-source-files
^done,files=[{file="myproc.c",fullname="/home/nickrob/myproc.c"},{file="myproc.c",fullname="/home/nickrob/myproc.c"},{file="mytest.c",fullname="/home/nickrob/mytest.c"},{file="mytest.c",fullname="/home/nickrob/mytest.c"}]
>From what people have said, I guess a different compiler may give a different
result.
--
Nick http://www.inet.net.nz/~nickrob
More information about the Gdb
mailing list