This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit+7.6.1] [patch] [7.6.1] Fix argv[0] symlink regression (PR 15415)
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Doug Evans <dje at google dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 28 Aug 2013 20:03:59 +0200
- Subject: [commit+7.6.1] [patch] [7.6.1] Fix argv[0] symlink regression (PR 15415)
- Authentication-results: sourceware.org; auth=none
- References: <20130826182111 dot GA19509 at host2 dot jankratochvil dot net> <21019 dot 47767 dot 404597 dot 352962 at ruffy dot mtv dot corp dot google dot com> <20130827140915 dot GA17861 at host2 dot jankratochvil dot net> <21022 dot 10862 dot 436924 dot 879667 at ruffy dot mtv dot corp dot google dot com>
On Wed, 28 Aug 2013 18:50:54 +0200, Doug Evans wrote:
> I can imagine good reasons to traverse at least some symlinks for the
> user's benefit.
Which one? This is discussed in:
Subject: [patch 2/3] Use gdb_realpath in gdb_bfd_open
https://sourceware.org/ml/gdb-patches/2013-08/msg00839.html
Message-ID: <20130828160547.GC23977@host2.jankratochvil.net>
> OTOH, calling gdb_realpath is like the last thing openp does.
> I think a reasonable case can be made that it's trying to do too much, and the
> caller should call gdb_realpath if s/he wants. One could provide a wrapper
> that calls openp and then realpath to simplify things, which in some sense
> is just a case of six-of-one. I guess it just feels cleaner to build
> features out of functions instead of flags.
That seems as a good idea, I will update:
[patch 1/3] Code cleanup: OPF_DISABLE_REALPATH -> OPF_RETURN_REALPATH
https://sourceware.org/ml/gdb-patches/2013-08/msg00838.html
Message-ID: <20130828160537.GB23977@host2.jankratochvil.net>
> > gdb/
> > 2013-08-27 Jan Kratochvil <jan.kratochvil@redhat.com>
> >
> > PR gdb/15415
> > * corefile.c (get_exec_file): Use exec_filename.
> > * defs.h (OPF_DISABLE_REALPATH): New definition. Add new comment.
> > * exec.c (exec_close): Free EXEC_FILENAME.
> > (exec_file_attach): New variable canonical_pathname. Use
> > OPF_DISABLE_REALPATH. Call gdb_realpath explicitly. Set
> > EXEC_FILENAME.
> > * exec.h (exec_filename): New.
> > * inferior.c (print_inferior, inferior_command): Use
> > PSPACE_EXEC_FILENAME.
> > * mi/mi-main.c (print_one_inferior): Likewise.
> > * progspace.c (clone_program_space, print_program_space): Likewise.
> > * progspace.h (struct program_space): New field pspace_exec_filename.
> > * source.c (openp): Describe OPF_DISABLE_REALPATH. New variable
> > realpath_fptr, initialize it from OPF_DISABLE_REALPATH, use it.
> >
> > gdb/testsuite/
> > 2013-08-27 Jan Kratochvil <jan.kratochvil@redhat.com>
> >
> > PR gdb/15415
> > * gdb.base/argv0-symlink.c: New file.
> > * gdb.base/argv0-symlink.exp: New file.
>
> LGTM
Therefore checked in:
https://sourceware.org/ml/gdb-cvs/2013-08/msg00149.html
and for 7.6.1:
https://sourceware.org/ml/gdb-cvs/2013-08/msg00150.html
Thanks,
Jan