summaryrefslogtreecommitdiffstats
path: root/lib/libproc
Commit message (Collapse)AuthorAgeFilesLines
* MFC r278658:rpaulo2015-02-201-3/+18
| | | | Teach libproc how to find debugging symbols in /usr/lib/debug.
* MFC r264400,r265836:ngie2014-12-314-4/+4
| | | | | | | | | | | | | | r264400: NO_MAN= has been deprecated in favor of MAN= for some time, go ahead and finish the job. ncurses is now the only Makefile in the tree that uses it since it wasn't a simple mechanical change, and will be addressed in a future commit. r265836: Remove last two NO_MAN= in the tree. In both of these cases, MAN= is what is needed.
* MFC r265255, r270506:markj2014-08-274-19/+65
| | | | | Allow "a.out" as an alias for the executable if no other matching entries are found.
* MFC r269750:dim2014-08-121-8/+2
| | | | | | | | | | | | | In r268463, I misplaced a return in demangle(), causing the function to erroneously skip symbols that were not mangled at all. Fix this by moving the return into the preceding if block. While here, simplify the code by letting __cxa_demangle() allocate the needed space for the demangled symbol. This also fixes a memory leak, which would occur whenever __cxa_demangle() failed. Reported by: pgj PR: base/191981
* MFC r265308:markj2014-08-093-24/+30
| | | | | If the traced process stops because it received a signal, libproc needs to ensure that the signal is forwarded when proc_continue() is called.
* MFC r268463:dim2014-07-162-18/+21
| | | | | | | | | | In libproc, avoid calling __cxa_demangle(), and thus depending on either libcxxrt or libsupc++, if WITHOUT_CXX is defined. [1] Noticed by: sbruno [1] However, on stable/10 this is more accurately described by WITHOUT_GNUCXX, so I've changed the test to that instead.
* MFC r264436:markj2014-04-291-3/+3
| | | | | | Fix some off-by-one errors. The kve_end and rdl_eaddr fields contain the first address after the end of the map entry and should therefore be excluded.
* MFC r258000:markj2013-12-271-7/+16
| | | | | | Consistently add the relocation offset only when the ELF type is not ET_EXEC. This fixes several problems with the DTrace pid provider not being able to match probes.
* MFC r257670:markj2013-12-271-7/+59
| | | | | | | | | | | Modify the libproc breakpoint add/remove functions to stop the target process if it has not already been stopped, since this is required for ptrace(2) to work. libdtrace does not seem to stop target processes before trying to remove their breakpoints, so we were previously failing to remove the breakpoint on r_debug_state() in rtld. This was causing processes to die with SIGTRAP if they called dlopen(3) after dtrace(1) had detached.
* MFC r257300:markj2013-12-271-2/+2
| | | | | Fix an off-by-one error when checking whether a given address is within the extent of a symbol.
* MFC r256661 r257222 r257235 r257248 r257298.markj2013-12-256-33/+34
| | | | | | | | | | | | | | | | | | | | | MFC r256661: Fix the libproc build when DEBUG is defined. MFC r257222: Clean up the debug printing in libproc a bit. In particular: * 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. MFC r257235: Remove an incorrect debug printf. MFC r257248: Fix the build with gcc. MFC r257298: Revert r257248 and fix the problem in a way that doesn't violate style(9).
* Fix the return value when we found a symbol in .dynstr. This nasty bug wasrpaulo2013-08-101-0/+1
| | | | preventing a lot of symbol lookups in dtruss -s, for example.
* - Compute the correct size to reallocate when doubling the size of thejhb2013-01-281-1/+2
| | | | | | | | | array of loaded objects to avoid a buffer overrun. - Use reallocf() to avoid leaking memory if the realloc() fails. PR: kern/175648 Submitted by: yuri@rawbw.com (1) MFC after: 1 week
* Fix libproc test case to work with clang premature optimizationpluknet2012-12-261-1/+1
| | | | | | | | | | observed with -O2 (used by default). Avoid function inlining for t1_bkpt_t on which we set a breakpoint. Otherwise the address of the function is never called thus the breakpoint never triggers. Reported by: zont Reviewed by: rpaulo
* Implement DTrace for PowerPC. This includes both 32-bit and 64-bit.jhibbits2012-11-072-0/+11
| | | | | | | | | | | There is one known issue: Some probes will display an error message along the lines of: "Invalid address (0)" I tested this with both a simple dtrace probe and dtruss on a few different binaries on 32-bit. I only compiled 64-bit, did not run it, but I don't expect problems without the modules loaded. Volunteers are welcome. MFC after: 1 month
* When calling the C++ demangler, make sure to free the returned buffer,rpaulo2012-09-071-6/+24
| | | | | | which might have been reallocated. Pointed out by: stefanf
* Add support for demangling C++ symbols. This requires linking libproc withrpaulo2012-09-062-2/+22
| | | | | | libc++rt/libsupc++. Discussed with: theraven
* Fix test cases to work with the latest version of the API.rpaulo2012-09-062-3/+4
|
* Make sure we visit both symbol sections even if one of them doesn'trpaulo2012-09-021-24/+21
| | | | exist. This makes it possible to dtrace some C++ programs like devd.
* Make libproc compilable for MIPSgonzo2012-03-232-0/+11
|
* fix a serious bug in libproc's proc_attachavg2011-08-031-2/+1
| | | | | | | | | | 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
* Fix a memory leak on the error conditionkevlo2010-12-141-1/+1
| | | | Reviewed by: rpaulo
* Ignore EINTR when calling waitpid.rpaulo2010-09-181-1/+2
|
* Several fixes for libproc:rpaulo2010-08-115-9/+25
| | | | | | | | o return the correct status in proc_wstatus() o proc_read takes a void * o correctly allocate the objs structure array Sponsored by: The FreeBSD Foundation
* Revert SHLIB_MAJOR to 2.rpaulo2010-07-311-1/+1
| | | | | As discussed with kan@, since DTrace is the only consumer of libproc right now, there's no need for a major shlib bump.
* Bump the shared library major version due to ABI conflicts.rpaulo2010-07-311-1/+1
| | | | Sponsored by: The FreeBSD Foundation
* New version of libproc. Changes are:rpaulo2010-07-3116-76/+1316
| | | | | | | | | | | * 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
* Removed redundant -I. from CFLAGS and "yes" from WITHOUT_MAN.ru2010-02-251-2/+2
|
* Build lib/ with WARNS=6 by default.ed2010-01-021-2/+0
| | | | | | | | | Similar to libexec/, do the same with lib/. Make WARNS=6 the norm and lower it when needed. I'm setting WARNS?=0 for secure/. It seems secure/ includes the Makefile.inc provided by lib/. I'm not going to touch that directory. Most of the code there is contributed anyway.
* Bump the version of all non-symbol-versioned shared libraries inkensmith2009-07-191-1/+1
| | | | | | | | preparation for 8.0-RELEASE. Add the previous version of those libraries to ObsoleteFiles.inc and bump __FreeBSD_Version. Reviewed by: kib Approved by: re (rwatson)
* Merge latest DTrace changes from Perforce.rodrigc2008-11-052-3/+10
| | | | | | Update libproc API to reflect new changes. Approved by: jb
* Add the Makefile for the process library which was missed in the previousjb2008-05-221-0/+20
| | | | commit.
* Add a process library with some stubs that the DTrace client needs.jb2008-05-225-0/+473
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.
OpenPOWER on IntegriCloud