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/17418] New: gdb should be smarter about exec-file mismatch when attaching


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

            Bug ID: 17418
           Summary: gdb should be smarter about exec-file mismatch when
                    attaching
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: dje at google dot com

gdb will figure out the file if one doesn't specify one when attaching.
[e.g., gdb will find it in /proc/$pid/exe]

But if one specifies the exec-file first, what should happen?
The current behaviour is confusing:

(gdb) exec-file ~/src/play/forever.x64
(gdb) attach 51016
Attaching to program: /home/dje/src/play/forever.x64, process 51016
Error reading attached process's symbol file.
: No such file or directory.

Process 51016 is actually a different program, not forever.x64.
Restarting gdb and trying again:

(gdb) attach 51016
Attaching to process 51016
Reading symbols from /home/dje/src/play/forever-threads.x64...done.

gdb should either flag an error or replace exec-file with the one from
/proc/$pid/exe.

Also, there's no reason why gdb couldn't print the name of the file in the
"Attaching to process ..." message (at least on systems with /proc/$pid/exe).

-- 
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]