[RFC] Record objfile->original_name as an absolute path

Doug Evans dje@google.com
Thu Sep 26 01:54:00 GMT 2013


On Wed, Sep 25, 2013 at 6:29 PM, Doug Evans <dje@google.com> wrote:
> Hi.
>
> The comment for objfile->original_name says the path is stored as an
> absolute path, but that's not the case, and that got me thinking:
> What if the user cd's before the debug info is accessed?
>
> This patch is only RFC, and not RFA, because I'm not sure how to do
> something better in the test.  I can certainly clean up what's there,
> if people think it's not *too* cheezy.
>
> [...]
>
> 2013-09-25  Doug Evans  <dje@google.com>
>
>         * objfiles.c (allocate_objfile): Save original_name as an absolute
>         path.
>         * objfiles.c (struct objfile): Expand comment on original_name.
>         * utils.c (gdb_abspath): New function.
>         * utils.h (gdb_abspath): Declare.
>
>         testsuite/
>         * gdb.dwarf/dwp-symlink.c: Fake out gdb to not load debug info
>         at start.
>         * gdb.dwarf/dwp-symlink.exp: Test trying to load dwp when the binary
>         has been specified with a relative path and we have chdir'd before
>         accessing the debug info.

One thought for doing the test differently is to have an option to the
"file" command that is the opposite of -readnow, that tells gdb to not
read any debug info (even to set the initial language).



More information about the Gdb-patches mailing list