Re: [patch] IS_ABSOLUTE_PATH to handle both DOS and POSIX path st yles

Doug Evans
2008-01-07T17:36:12Z

On Jan 6, 2008 8:17 PM, Eli Zaretskii <eliz@gnu.org> wrote:
> > Date: Sun, 6 Jan 2008 13:07:25 -0800
> > From: "Doug Evans" <dje@google.com>
> > Cc: drow@false.org, gdb-patches@sources.redhat.com, ARistovski@qnx.com,
> > gcc-patches@gcc.gnu.org, RMansfield@qnx.com
> >
> > What would the option apply to? How would the user know when and when
> > not to use it?
>
> I don't really understand the question. How would the user know when
> to use any other option? If they read the documentation and
> understand the issues, they will know.

I realize the question may sound odd. I asked it because the range to
which the option may apply seems vast, whereas the range to which it
will be applied (AIUI) seems small, leading to excessive confusion.
If I'm mistaken about that then ignore the question.

Of course, one might be able to come up with a suitable enough name
for the option to mitigate the confusion. I don't know. I'd be
curious to see a patch.

> > One thing that occurs to me is what if I do "bash$ gdb
> > /prog/with/other/path/format"? Will gdb need to know the format
> > before the user gets a chance to specify the format?
>
> No. We were talking about finding sources given file names recorded
> in the debug info. Finding the program given the command-line
> arguments is not the same problem, and I don't thing GDB uses any of
> these macros to do that, or needs to.

Perhaps I should have written "gdb
prog.with.other.path.format.in.debug.info". :-)
As a datapoint, and to give some context for the above, I patched
filenames.h to print a message whenever IS_ABSOLUTE_PATH is called.

dje@ruffy:~$ ./gdb -nx hello
GNU gdb 6.7.50.20080104-cvs
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux"...
IS_ABSOLUTE_PATH (/home/dje/hello.x32)
IS_ABSOLUTE_PATH (/home/dje/hello.x32)
IS_ABSOLUTE_PATH (start.S)
IS_ABSOLUTE_PATH (../sysdeps/i386/elf/start.S)
IS_ABSOLUTE_PATH (crti.S)
IS_ABSOLUTE_PATH (/build/buildd/glibc-2.3.6/build-tree/i386-libc/csu/crti.S)
IS_ABSOLUTE_PATH (hello.c)
IS_ABSOLUTE_PATH (hello.c)
IS_ABSOLUTE_PATH (crtn.S)
IS_ABSOLUTE_PATH (/build/buildd/glibc-2.3.6/build-tree/i386-libc/csu/crtn.S)
(gdb)