This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gdb/21214] New: exec_file_attach uses gdb_realpath instead of gdb_realpath_keepfile


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

            Bug ID: 21214
           Summary: exec_file_attach uses gdb_realpath instead of
                    gdb_realpath_keepfile
           Product: gdb
           Version: 7.10
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: sameer.varyani at gmail dot com
  Target Milestone: ---

exec_file_attach is used atleast in 2 different scenarios:
1. When attaching to a running process.
2. When the underlying executable is modified and gdb tries to reload the
symbols + exec.

In the second case, argv[0] is modified to the linked file if the executable is
a link, which breaks the executable as it relies on the file name/path.

A similar bug was reported for an earlier version of gdb and was fixed for only
the first time the symbol file is read, but not for reload.

most likely fix:
this is based on  source from
gdb-7.10(ftp://sourceware.org/pub/gdb/snapshots/branch/gdb-7.10.0.20151204.tar.xz)

diff exec.c exec.c.orig
274c274
<         canonical_pathname = gdb_realpath_keepfile (scratch_pathname);
---
> 	  canonical_pathname = gdb_realpath (scratch_pathname);

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]