From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25095 invoked by alias); 23 Oct 2013 13:30:33 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 25071 invoked by uid 48); 23 Oct 2013 13:30:32 -0000 From: "janerikdahlin at yahoo dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/16079] New: GDB replaces symlinks when reloading the executable Date: Wed, 23 Oct 2013 13:30:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: 7.6 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: janerikdahlin at yahoo dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013-q4/txt/msg00100.txt.bz2 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 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 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: ... 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.