In the normal case and correct failure cases, the 'phdl' pointer is passed to
callers to use or clean up as needed. However, some failure cases returned
early, failing to export the phdl pointer.
This was introduced in the restructuring of r303533.
Reported by: Coverity
CID: 1361070
Reviewed by: markj
Sponsored by: EMC / Isilon Storage Division
This is used by libdtrace to determine the data model of target processes.
This allows for the creation of pid provider probes in 32-bit processes on
amd64.
MFC after: 1 month
* Don't print any error messages to stderr unless DEBUG is defined.
* Add a DPRINTFX macro for use when errno isn't set.
* Print the error string from libelf when appropriate.
proc_attach always frees any struct proc_handle data
that it allocates, but that is supposed to be done
only in error conditions.
PR: bin/158431
Approved by: re (kib)
MFC after: 1 week
* breakpoint setup support
* register query
* symbol to address mapping and vice-versa
* more misc utility functions based on their Solaris counterpart
Also, I've written some test cases.
Sponsored by: The FreeBSD Foundation
These will be fleshed out as part of the DTrace userland tracing
development.
For now, the kernel tracing part of DTrace requires minimal functionality
for this library.
The API for this library is deliberately different from the libproc in
OpenSolaris due to licensing restrictions.