public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/16079] New: GDB replaces symlinks when reloading the executable
@ 2013-10-23 13:30 janerikdahlin at yahoo dot com
  2022-04-05 18:20 ` [Bug gdb/16079] " tromey at sourceware dot org
  0 siblings, 1 reply; 2+ messages in thread
From: janerikdahlin at yahoo dot com @ 2013-10-23 13:30 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=16079

            Bug ID: 16079
           Summary: GDB replaces symlinks when reloading the executable
           Product: gdb
           Version: 7.6
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: janerikdahlin at yahoo dot com

When starting gdb with a symlink in CWD it starts the executable in CWD, but
after reloading the executable, typically after a rebuild, it is started at the
destination of the symlink. This is rather impractical if you rely on the value
of arg[0].

Steps to reproduce:
---------
dalle@blahonga:~$ cat somewhere/foo.c 
#include <stdio.h>

int main (int argc, char *argv[])
{
  puts(argv[0]);
  return 0;
}
dalle@blahonga:~$ gcc -g -o somewhere/foo somewhere/foo.c
dalle@blahonga:~$ ln -s somewhere/foo bar
dalle@blahonga:~$ gdb bar
GNU gdb (GDB) 7.6.1-ubuntu
Copyright (C) 2013 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 "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/dalle/somewhere/foo...done.
(gdb) r
Starting program: /home/dalle/bar           <<<< file on the command line
/home/dalle/bar                             <<<< argv from the gdb command line
[Inferior 1 (process 27285) exited normally]
(gdb) ^Z
[1]+  Stopped                 gdb bar
dalle@blahonga:~$ touch somewhere/foo
dalle@blahonga:~$ fg
gdb bar
r
`/home/dalle/somewhere/foo' has changed; re-reading symbols.
Starting program: /home/dalle/somewhere/foo <<<< file the symlink refered to
/home/dalle/somewhere/foo                   <<<< something else
[Inferior 1 (process 27295) exited normally]

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug gdb/16079] GDB replaces symlinks when reloading the executable
  2013-10-23 13:30 [Bug gdb/16079] New: GDB replaces symlinks when reloading the executable janerikdahlin at yahoo dot com
@ 2022-04-05 18:20 ` tromey at sourceware dot org
  0 siblings, 0 replies; 2+ messages in thread
From: tromey at sourceware dot org @ 2022-04-05 18:20 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=16079

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
                 CC|                            |tromey at sourceware dot org
             Status|NEW                         |RESOLVED

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
I think this was probably fixed in bug #15415.

*** This bug has been marked as a duplicate of bug 15415 ***

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-05 18:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-23 13:30 [Bug gdb/16079] New: GDB replaces symlinks when reloading the executable janerikdahlin at yahoo dot com
2022-04-05 18:20 ` [Bug gdb/16079] " tromey at sourceware 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).