public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/15934] New: Keep directories for argv[0]
@ 2013-09-05 13:07 jan.kratochvil at redhat dot com
2022-04-05 14:38 ` [Bug gdb/15934] " tromey at sourceware dot org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: jan.kratochvil at redhat dot com @ 2013-09-05 13:07 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=15934
Bug ID: 15934
Summary: Keep directories for argv[0]
Product: gdb
Version: HEAD
Status: NEW
Severity: minor
Priority: P2
Component: gdb
Assignee: unassigned at sourceware dot org
Reporter: jan.kratochvil at redhat dot com
Re: [commit+7.6.1] [patch] [7.6.1] Fix argv[0] symlink regression (PR 15415)
https://sourceware.org/ml/gdb-patches/2013-09/msg00138.html
Message-ID: <52276600.7010706@redhat.com>
3 <null> /home/pedro/gdb/mygit/build/gdb/./gdbserver/../gdb
2 <null> /home/pedro/gdb/mygit/build/gdb/./gdb
Problem #1: ./ could be removed/simplified.
Problem #2: gdbserver/../ could be also removed/simplified
But argv[0] should be kept possibly unchanged from the user input.
This also means argv[0] should be kept in relative (not absolute pathname)
form; but GDB should better display absolute pathnames to user, which will not
match argv[0] much.
Going to use gdb_realpath_keepfile() (former xfullpath()) so the directories
get lost even for inferior argv[0]. Inferiors care only about exact basename
in argv[0] anyway.
The goal of this PR fix would be to pass argv[0] unchanged to inferior while
still displaying it to user in both convenient (canonical absolute form) but
also the exact argv[0] form (original form, even if relative).
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug gdb/15934] Keep directories for argv[0]
2013-09-05 13:07 [Bug gdb/15934] New: Keep directories for argv[0] jan.kratochvil at redhat dot com
@ 2022-04-05 14:38 ` tromey at sourceware dot org
2022-04-05 19:06 ` tromey at sourceware dot org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: tromey at sourceware dot org @ 2022-04-05 14:38 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=15934
Tom Tromey <tromey at sourceware dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tromey at sourceware dot org
--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
I have a somewhat similar problem.
Suppose the user does 'file zzz', where zzz is a symlink.
Then, after running, the user resets the symlink to point to some
other file.
In this case, gdb won't change -- because the realpath'ing in
the objfile creation path will wind up resolving the symlink,
and so reread_symbols will think nothing has changed.
Locally this is complicated by the fact that we have a workaround
for the Windows gnulib/BFD stat mismatch bug in place.
I think my partial solution will be to remove OPF_RETURN_REALPATH
from symfile_bfd_open.
A full solution for this bug would probably involve storing the
user-specified name in the objfile and then changing various
spots in gdb to use that. That is, the objfile would need one
name and the BFD would get another.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug gdb/15934] Keep directories for argv[0]
2013-09-05 13:07 [Bug gdb/15934] New: Keep directories for argv[0] jan.kratochvil at redhat dot com
2022-04-05 14:38 ` [Bug gdb/15934] " tromey at sourceware dot org
@ 2022-04-05 19:06 ` tromey at sourceware dot org
2022-04-06 16:00 ` tromey at sourceware dot org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: tromey at sourceware dot org @ 2022-04-05 19:06 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=15934
--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
I suppose only the executable would need any special treatment.
But for that, I wonder how it would work in the startup-with-shell
case. Without a shell, gdb can easily control argv[0].
With a shell, it seems harder, particularly if the executable
was specified relative to one working directory, but then
the cwd was changed in the gdb session.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug gdb/15934] Keep directories for argv[0]
2013-09-05 13:07 [Bug gdb/15934] New: Keep directories for argv[0] jan.kratochvil at redhat dot com
2022-04-05 14:38 ` [Bug gdb/15934] " tromey at sourceware dot org
2022-04-05 19:06 ` tromey at sourceware dot org
@ 2022-04-06 16:00 ` tromey at sourceware dot org
2023-11-13 10:25 ` sam at gentoo dot org
2023-11-13 10:25 ` sam at gentoo dot org
4 siblings, 0 replies; 6+ messages in thread
From: tromey at sourceware dot org @ 2022-04-06 16:00 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=15934
--- Comment #3 from Tom Tromey <tromey at sourceware dot org> ---
See also bug #24143. I have a patch that fixes that one
(basically what I wrote here in comment #1) and so gets this
one a little closer.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug gdb/15934] Keep directories for argv[0]
2013-09-05 13:07 [Bug gdb/15934] New: Keep directories for argv[0] jan.kratochvil at redhat dot com
` (2 preceding siblings ...)
2022-04-06 16:00 ` tromey at sourceware dot org
@ 2023-11-13 10:25 ` sam at gentoo dot org
2023-11-13 10:25 ` sam at gentoo dot org
4 siblings, 0 replies; 6+ messages in thread
From: sam at gentoo dot org @ 2023-11-13 10:25 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=15934
Sam James <sam at gentoo dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |sam at gentoo dot org
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug gdb/15934] Keep directories for argv[0]
2013-09-05 13:07 [Bug gdb/15934] New: Keep directories for argv[0] jan.kratochvil at redhat dot com
` (3 preceding siblings ...)
2023-11-13 10:25 ` sam at gentoo dot org
@ 2023-11-13 10:25 ` sam at gentoo dot org
4 siblings, 0 replies; 6+ messages in thread
From: sam at gentoo dot org @ 2023-11-13 10:25 UTC (permalink / raw)
To: gdb-prs
https://sourceware.org/bugzilla/show_bug.cgi?id=15934
Sam James <sam at gentoo dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
See Also| |https://sourceware.org/bugz
| |illa/show_bug.cgi?id=24143
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-11-13 10:25 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-05 13:07 [Bug gdb/15934] New: Keep directories for argv[0] jan.kratochvil at redhat dot com
2022-04-05 14:38 ` [Bug gdb/15934] " tromey at sourceware dot org
2022-04-05 19:06 ` tromey at sourceware dot org
2022-04-06 16:00 ` tromey at sourceware dot org
2023-11-13 10:25 ` sam at gentoo dot org
2023-11-13 10:25 ` sam at gentoo dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).