Re: MI: -file-list-exec-source-files

Eli Zaretskii
2006-06-04T03:34:22Z

> Date: Sat, 3 Jun 2006 18:35:37 -0400
> From: Daniel Jacobowitz <drow@false.org>
> Cc: Eli Zaretskii <eliz@gnu.org>, susan@smacchia.net, jimb@codesourcery.com,
> gdb@sourceware.org
>
> > > Sounds like we should implement duplicate removal from the UI lists?
> >
> > I'm not sure. It may take GDB longer to remove the duplicate entries than
> > it does for Emacs to read them. It would be best not to create them in the
> > first place, but maybe that's not easily done.
>
> There are two potential sources of duplication: bugs, e.g. in our
> processing of symbol vs. line information, and actual duplicate entries
> in the debug info. As Susan correctly noted, the duplicates are often
> legitimate and discarding them entirely would be bad. But it sounds
> like the ones you're observing are the result of a bug.

If the duplicates are due to a bug, then we should fix the bug.
Otherwise, the only way not to have the duplicates is to detect them
and remove them.

FWIW, GDB 6.3 doesn't seem to have this problem, AFAICS:

eliz@fencepost:~$ ./gdb-6.3/gdb/gdb --interpreter=mi2 ./mytest
~"GNU gdb 6.3\n"
~"Copyright 2004 Free Software Foundation, Inc.\n"
~"GDB is free software, covered by the GNU General Public License, and you are\n"
~"welcome to change it and/or distribute copies of it under certain conditions.\n"
~"Type \"show copying\" to see the conditions.\n"
~"There is absolutely no warranty for GDB. Type \"show warranty\" for details.\n"
~"This GDB was configured as \"i686-pc-linux-gnu\"..."
~"Using host libthread_db library \"/lib/tls/libthread_db.so.1\".\n"
~"\n"
(gdb)
-file-list-exec-source-files
^done,files=[{file="crtn.S"},{file="/build/buildd/glibc-2.3.2.ds1/build-tree/i386-libc/csu/crtn.S"},{file="myproc.c",fullname="/home/e/eliz/myproc.c"},{file="mytest.c",fullname="/home/e/eliz/mytest.c"},{file="crti.S"},{file="/build/buildd/glibc-2.3.2.ds1/build-tree/i386-libc/csu/crti.S"},{file="init.c"},{file="start.S"},{file="../sysdeps/i386/elf/start.S"}]