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 #5 from phantall at gmail dot com ---
Created attachment 8851
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8851&action=edit
unix procfs to_pid_to_exec_file implementation

This implementation is generic enough that it could be used for all procfs
platforms that adhere to the possible paths I used.

Some notes on this:

* I'm not terribly fond of the idea of returning a static like this, but the 
code using it (exec_file_locate_attach) is written under the assumption it does
not take ownership of that memory.
* This could be done with no loop:
** ... using #if, but that makes the code uglier/less readable, and I see no
terribly compelling argument against the loop
** On each platform add a format string to the target_ops struct (would require
adding a new member to target_ops).
** Only use the string that works on Solaris and forget about making it more
general purpose

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