This is the mail archive of the gdb-patches@sourceware.org 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: [PATCH] symfile.c, find_separate_debug_file


On Thu, Aug 02, 2007 at 09:36:27PM -0700, Michael Snyder wrote:
> The existing code doesn't use it.  If you want me to undertake to
> revise the code to use DIR_SEPARATOR, I'll be glad to do it.

  for (i = strlen(dir) - 1; i >= 0; i--)
    {
      if (IS_DIR_SEPARATOR (dir[i]))
        break;
    }
  gdb_assert (i >= 0 && IS_DIR_SEPARATOR (dir[i]));

...

  if (canon_name
      && strncmp (canon_name, gdb_sysroot, strlen (gdb_sysroot)) == 0
      && IS_DIR_SEPARATOR (canon_name[strlen (gdb_sysroot)]))

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.

-- 
Daniel Jacobowitz
CodeSourcery


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