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 tdep/17903] gdb cannot determine executable when attaching to processes on Solaris


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

--- Comment #3 from phantall at gmail dot com ---
I was able to fix this with a hack.  I imagine someone who knows the gdb src
tree would be able to get this fixed in a more generic manner.

I added a new function in sparc-sol2-nat.c that's identical to
Linux_proc_pid_to_exec_file in gdb/nat/Linux-procfs.c, with the following
changes:

> static char* solaris_proc_pid_to_exec_file( struct target_ops *self, int pid ) {
>   /*...*/
>   xsnprintf( name, PATH_MAX, "/proc/%d/path/a.out", pid );

Then in _initialize_sparc_sol2_nat I added the new function:

>  t = procfs_target ();
>  t->to_pid_to_exec_file = solaris_proc_pid_to_exec_file;


This resolves the problem.

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