This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFC: add relative file name handling for linespecs
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: gdb-patches at sourceware dot org, tromey at redhat dot com
- Date: Sat, 08 Dec 2012 20:32:39 +0200
- Subject: Re: RFC: add relative file name handling for linespecs
- References: <m3d3arlez3.fsf@fleche.redhat.com> <83ipkjeagi.fsf@gnu.org> <m3boq93o5q.fsf@fleche.redhat.com> <20121208163407.GA11843@host2.jankratochvil.net>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Sat, 8 Dec 2012 17:34:07 +0100
> From: Jan Kratochvil <jan.kratochvil@redhat.com>
> Cc: gdb-patches@sourceware.org, Tom Tromey <tromey@redhat.com>
>
> Hi Eli,
>
> On Wed, 11 Jan 2012 22:49:37 +0100, Tom Tromey wrote:
> > Tom> + /* Either the names must completely match, or the character
> > Tom> + preceding the trailing SEARCH_NAME segment of FILENAME must be a
> > Tom> + directory separator. */
> > Tom> + return (len == search_len
> > Tom> + || IS_DIR_SEPARATOR (filename[len - search_len - 1]));
> >
> > Eli> What about the (somewhat perverse) case of "d:foo/bar" and "foo/bar"
> > Eli> on Windows?
> >
> > Would something like this work?
> >
> > || (HAS_DRIVE_SPEC (filename) && len - search_len == 2)
>
> FILENAME here is from the debug info file (not from the user), I believe on
> MinGW the path from DWARF is absolute (like in UNIX) and it has the format
> d:\foo\bar (not d:foo\bar), doesn't it?
If this comes only from debug info, I guess you are right, although it
would be good to make sure GCC never writes such names into debug info.