Commit Graph

79 Commits

Author SHA1 Message Date
Bryan Drewery
d48a2d2303 Remove WARNS inherited fine by ../Makefile.inc.
Sponsored by:	EMC / Isilon Storage Division
2016-02-26 22:14:23 +00:00
Ruslan Bukin
7dd3aed9c9 Add support for RISC-V ISA.
Reviewed by:	andrew
Sponsored by:	DARPA, AFRL
Sponsored by:	HEIF5
Differential Revision:	https://reviews.freebsd.org/D5040
2016-01-24 12:10:29 +00:00
Bryan Drewery
eacae6dc66 Fix LDADD/DPADD that should be LIBADD.
Sponsored by:	EMC / Isilon Storage Division
2015-12-04 03:17:47 +00:00
Bryan Drewery
db548a6148 META MODE: Rework circular dependency guard for librtld_db/libproc.
librtld_db only needs libutil.h to build, not the libproc library.  So
it can safely use its header and allow libproc to depend on librtld_rb
to be built first to link.  This is required after fixing ld --sysroot
in r291226.

Sponsored by:	EMC / Isilon Storage Division
2015-11-25 19:13:35 +00:00
Bryan Drewery
7b3ea376a2 META MODE: Prefer INSTALL=tools/install.sh to lessen the need for xinstall.host.
This both avoids some dependencies on xinstall.host and allows
bootstrapping on older releases to work due to lack of at least 'install -l'
support.

Sponsored by:	EMC / Isilon Storage Division
2015-11-25 19:10:28 +00:00
Enji Cooper
b2d48be1bc Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) and
netbsd-tests.test.mk (r289151)

- Eliminate explicit OBJTOP/SRCTOP setting
- Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk
- Remove unnecessary TESTSDIR setting
- Use SRCTOP where possible for clarity

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Divison
2015-10-12 08:16:03 +00:00
Ed Maste
9b68037fd0 Enable libproc symbol_lookup tests on arm64
This reverts part of r286863, as the kernel support required by these
tests was added in r287105.

PR:		202305
Sponsored by:	The FreeBSD Foundation
2015-08-31 20:30:06 +00:00
Andrew Turner
e3c074a017 Fix libproc on architectures that don't need the program counter to be
adjusted. This seems to be the case on all non-x86 architectures libproc
supports.

Reviewed by:	kib
Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3465
2015-08-24 12:17:15 +00:00
Ed Maste
5e3cac3e57 On arm64 disable three tests that hang or panic
Each issue has a PR open to track. This workaround allows us to run the
tests to investigate the failures and avoid any new regressions.

PR:		202304, 202305, 202307
Reviewed by:	ngie
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3378
2015-08-17 23:19:36 +00:00
Ruslan Bukin
27e54fb59e Make libproc compilable on AArch64. 2015-07-01 13:59:26 +00:00
Simon J. Gerraty
ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty
44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty
98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Baptiste Daroussin
f8eb7ac92c Fix underlinking 2015-05-19 22:23:15 +00:00
Stanislav Sedov
0faaddb8db Fix debug symbols loading in libproc: 0 is a valid file descriptor.
Reported by:	Chris Torek <chris.torek@gmail.com>
2015-03-13 04:26:48 +00:00
Rui Paulo
eda94c07de Teach libproc how to find debugging symbols in /usr/lib/debug.
MFC after:	1 week
2015-02-13 03:18:29 +00:00
George V. Neville-Neil
fcb5606706 Initial version of DTrace on ARM32.
Submitted by:	Howard Su based on work by Oleksandr Tymoshenko
Reviewed by:	ian, andrew, rpaulo, markj
2015-02-10 19:41:30 +00:00
Mark Johnston
c7fa6f0bb0 Stop iterating and return if the caller-supplied callback function returns
a non-zero value.

MFC after:	1 week
2015-01-31 03:22:00 +00:00
Mark Johnston
cd9c993950 Ensure that we don't try to demangle a symbol name if we failed to look
up the symbol. Add a test to exercise this code path.

Reviewed by:	adrian
2015-01-25 00:34:43 +00:00
Mark Johnston
3f1cbdbeb1 Fix a memory leak that occured when looking up CTF info for a symbol. 2014-12-23 15:40:57 +00:00
Baptiste Daroussin
6b129086dc Convert libraries to use LIBADD
While here reduce a bit overlinking
2014-11-25 11:07:26 +00:00
Simon J. Gerraty
9268022b74 Merge from head@274682 2014-11-19 01:07:58 +00:00
Mark Johnston
ec04549052 Remove an incorrect and useless debug print.
X-MFC-With:	r272488
2014-10-04 02:34:30 +00:00
Mark Johnston
41da933c87 Hook up support for userland CTF support in DTrace. This required some
modifications to libproc to support fetching the CTF info for a given file.

With this change, dtrace(1) is able to resolve type info for function and
USDT probe arguments, and function return values. In particular, the args[n]
syntax should now work for referencing arguments of userland probes,
provided that the requisite CTF info is available.

The uctf tests pass if the test programs are compiled with CTF info. The
current infrastructure around the DTrace test suite doesn't support this
yet.

Differential Revision:	https://reviews.freebsd.org/D891
MFC after:		1 month
Relnotes:		yes
Sponsored by:		EMC / Isilon Storage Division
2014-10-03 23:20:37 +00:00
Mark Johnston
540cc663b1 Factor out some of the duplicated code in the symbol lookup functions, in
preparation for adding userland CTF support to DTrace.

MFC after:	1 month
Sponsored by:	EMC / Isilon Storage Division
2014-09-25 19:08:06 +00:00
Mark Johnston
9351ac6d69 Add some ATF tests for libproc.
Differential Revision:	D710
Reviewed by:	jmmv, ngie, rpaulo
2014-09-21 21:25:41 +00:00
Mark Johnston
24a08d303e Fix a bug in r265255: only return NULL if the requested map wasn't found.
Submitted by:	Luke Chang-Hsien Tsai <luke.tw@gmail.com>
MFC after:	1 week
2014-08-24 17:02:27 +00:00
Simon J. Gerraty
ee7b0571c2 Merge head from 7/28 2014-08-19 06:50:54 +00:00
Dimitry Andric
96ec3cdd8e 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
MFC after:	3 days
2014-08-09 12:25:06 +00:00
Dimitry Andric
3d12a34380 In libproc, avoid calling __cxa_demangle(), and thus depending on either
libcxxrt or libsupc++, if WITHOUT_CXX is defined.

Noticed by:	sbruno
MFC after:	1 week
2014-07-09 17:31:57 +00:00
Simon J. Gerraty
fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty
76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty
cc3f4b9965 Merge from head 2014-05-08 23:54:15 +00:00
Warner Losh
c6063d0da8 Use src.opts.mk in preference to bsd.own.mk except where we need stuff
from the latter.
2014-05-06 04:22:01 +00:00
Simon J. Gerraty
b736a4db5b New/updated dependencies 2014-05-05 18:31:00 +00:00
Mark Johnston
92f92525d1 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 after:	3 weeks
2014-05-04 03:34:32 +00:00
Mark Johnston
acc0eea6b0 Allow "a.out" as an alias for the executable if no other matching entries
are found. This improves compatibility with Solaris' libproc and fixes a
number of failing DTrace tests that rely on this feature.

MFC after:	3 weeks
2014-05-03 04:44:03 +00:00
Simon J. Gerraty
9d2ab4a62d Merge head 2014-04-27 08:13:43 +00:00
Mark Johnston
1e6b385830 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 after:	2 weeks
2014-04-14 00:24:04 +00:00
Warner Losh
3bdf775801 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.
2014-04-13 05:21:56 +00:00
Warner Losh
40b86d77c7 The proper way to request no man pages currently is NO_MAN=xxx. Use it
in preference to the user WITHOUT_MAN knob, which should never be set
in normal src Makefiles.
2014-04-05 17:54:36 +00:00
Mark Johnston
fbce8e1683 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.

Reviewed by:	rpaulo
MFC after:	2 weeks
2013-11-11 16:57:57 +00:00
Mark Johnston
813b26945c 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.

Reported by:	symbolics@gmx.com
Reviewed by:	rpaulo
MFC after:	1 month
2013-11-05 03:23:54 +00:00
Mark Johnston
4ec6017e0b Fix an off-by-one error when checking whether a given address is within
the extent of a symbol.

Submitted by:	Prashanth Kumar <pra_udupi@yahoo.co.in>
Reviewed by:	rpaulo
MFC after:	1 week
2013-10-29 03:52:05 +00:00
Mark Johnston
fb15925c14 Revert r257248 and fix the problem in a way that doesn't violate style(9).
Suggested by:	jmg
2013-10-29 03:12:31 +00:00
Mark Johnston
2e14fd4313 Fix the build with gcc. 2013-10-28 12:42:27 +00:00
Mark Johnston
7a514b6277 Remove an incorrect debug printf. 2013-10-28 01:41:59 +00:00
Mark Johnston
30e81f7e3b 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.
2013-10-27 20:39:10 +00:00
Mark Johnston
25aecfbb23 Fix the libproc build when DEBUG is defined. 2013-10-17 03:39:21 +00:00
Simon J. Gerraty
d1d0158641 Merge from head 2013-09-05 20:18:59 +00:00