This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Record objfile->original_name as an absolute path
- From: Doug Evans <dje at google dot com>
- To: gdb-patches <gdb-patches at sourceware dot org>, Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Date: Wed, 25 Sep 2013 18:53:58 -0700
- Subject: Re: [RFC] Record objfile->original_name as an absolute path
- Authentication-results: sourceware.org; auth=none
- References: <yjt2zjr09xqr dot fsf at ruffy dot mtv dot corp dot google dot com>
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).