From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27874 invoked by alias); 29 Jan 2015 13:04:31 -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 25293 invoked by uid 48); 29 Jan 2015 13:04:30 -0000 From: "ro at TechFak dot Uni-Bielefeld.DE" To: gdb-prs@sourceware.org Subject: [Bug tdep/17903] New: gdb cannot determine executable when attaching to processes on Solaris Date: Thu, 29 Jan 2015 18:29:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: tdep X-Bugzilla-Version: 7.8 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ro at TechFak dot Uni-Bielefeld.DE 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 cf_gcchost 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: 2015-q1/txt/msg00135.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=17903 Bug ID: 17903 Summary: gdb cannot determine executable when attaching to processes on Solaris Product: gdb Version: 7.8 Status: NEW Severity: normal Priority: P2 Component: tdep Assignee: unassigned at sourceware dot org Reporter: ro at TechFak dot Uni-Bielefeld.DE Host: *-*-solaris2.* When attaching to a running process, gdb cannot determine the executable on Solaris, thus has no symbol information. Linux is different here: ro@fozzie 148 > gdb GNU gdb (GDB) 7.8 [...] This GDB was configured as "x86_64-unknown-linux-gnu". [...] (gdb) attach 2092 Attaching to process 2092 Reading symbols from /usr/local/bin/bash...done. [...] 0x0000003231abc2fc in waitpid () from /lib64/libc.so.6 (gdb) where #0 0x0000003231abc2fc in waitpid () from /lib64/libc.so.6 #1 0x000000000043d23b in waitchld (wpid=, block=1) at jobs.c:3093 #2 0x000000000043ec3b in wait_for (pid=26784) at jobs.c:2450 #3 0x0000000000430470 in execute_command_internal (command=0x2519600, asynchronous=0, pipe_in=-1, pipe_out=, fds_to_close=) at execute_cmd.c:775 #4 0x000000000042deef in execute_command (command=0x2519600) at execute_cmd.c:382 #5 0x000000000041db38 in reader_loop () at eval.c:152 #6 0x000000000041d60b in main (argc=, argv=0x7fffddd4e878, env=0x7fffddd4e888) at shell.c:749 On Solaris, you get far less information instead: ro@lokon 2721 > gdb GNU gdb (GDB) 7.8 [...] This GDB was configured as "i386-pc-solaris2.10". [...] (gdb) attach 2032 Attaching to process 2032 [New process 2032] Retry #1: Retry #2: Retry #3: Retry #4: 0xfe6cbc55 in ?? () This happens because Solaris currently doesn't implement the to_pid_to_exec_file, although that's certainly feasible: * On Solaris 10 and beyond, there's /proc//path/a.out, the exact equivalent to Linux' /proc//exe, it seems. * Before, there's at least a heuristic available: the execname can be accessed via the AT_SUN_EXECNAME auxv entry, but that can be a relative path. One could combine it with /proc//cwd, but that's unreliable since the process could have run chdir between exec and attach. Rainer -- You are receiving this mail because: You are on the CC list for the bug.