This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] symfile.c, find_separate_debug_file
> Adding "/" to strings is fine; it's when looking at passed in strings
> that you have to check directory separators more carefully.
>
> On Fri, Aug 03, 2007 at 12:10:30AM -0700, Michael Snyder wrote:
> > Well I don't know -- they seemed to hurt when I tried it,
> > and getting rid of them certainly seemed to help.
> >
> > If I type /usr/lib//tmp/foo, isn't that equivalent, at least
> > in some contexts, to typing /tmp/foo?
>
> To my knowledge this is true only in Emacs, not in any normal
> operating system's file access routines. GDB does not run on top of
> Emacs...
>
> Maybe you could describe how it seemed to hurt.
Sure. It generates a string such as
"/usr/local/lib/debug//opt/grbx/lib.so",
which is then passed to the libc function 'open', which fails to find the
file.
When I remove the extra slash, open succeeds.
This is glibc 2.5 running under UML in Scratchbox, on Ubuntu.
Gdb is x86-cross-x86, not that that's probably relevant.