This is the mail archive of the gdb-patches@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]

[PATCH][PR gdb/17903] Implement to_pid_to_exec_file for solaris


This patch is to address an issue in Solaris,
bug 17903.

When attaching to a process by PID the current
implementation in gdb/procfs.c leaves
"to_pid_to_exec_file" at the default -- a stub
function that returns NULL.

This causes symbols not to load when attaching,
forcing the user to either attach by specifying
the path on the command line or inside gdb.
After specifying the file inside gdb it's also
necessary to manually load symbolic information.

The proposed change resembles the implementation
in gdb/linux-nat.c, but is generic enough that it
could work on most platforms supporting procfs
and could potentially be used as a replacement
for the current default.

If you only care about fixing this in Solaris 10+,
the loop could be done away with and readlink
could just read from "/proc/self/path/a.out",
allowing you to get rid of the xsnprintf call
as well.

I don't have DejaGNU installed on my development
machines at work and I don't have one [that functions]
at home, so I was unable to run the test suite (otherwise
I would have).

Lastly: I made these changes on a machine that
doesn't have network access.  I had to hand-type
the following diff.  My apologies if there are
typos; I did my best.  Obviously I won't be able to
push this myself.

Attachment: gdb-17903-patch.txt
Description: Text document


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