citrun

watch C/C++ source code execute
Log | Files | Refs | LICENSE

commit 5550a571af533e0de605b075003f527cb0f0ecd5
parent 457bccd011b284915171595e2e5f58ccb1059842
Author: Kyle Milz <kyle@0x30.net>
Date:   Fri,  8 Jul 2016 20:51:42 -0600

man: polish

Diffstat:
Mman/citrun-gl.1 | 19+++++++++++++++++--
Mman/citrun-inst.1 | 50+++++++++++++++++++++++++++++++++-----------------
Mman/citrun-wrap.1 | 67+++++++++++++++++++++++++++++++++++++++++++------------------------
3 files changed, 93 insertions(+), 43 deletions(-)

diff --git a/man/citrun-gl.1 b/man/citrun-gl.1 @@ -1,9 +1,24 @@ -.Dd April 9, 2016 +.\" +.\" Copyright (c) 2016 Kyle Milz <kyle@0x30.net> +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: April 9 2016 $ .Dt CITRUN-GL 1 .Os .Sh NAME .Nm citrun-gl -.Nd watch instrumented binaries run +.Nd interact with instrumented binaries .Sh SYNOPSIS .Nm .Sh DESCRIPTION diff --git a/man/citrun-inst.1 b/man/citrun-inst.1 @@ -1,35 +1,51 @@ -.Dd April 1, 2016 +.\" +.\" Copyright (c) 2016 Kyle Milz <kyle@0x30.net> +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: April 1 2016 $ .Dt CITRUN-INST 1 .Os .Sh NAME .Nm citrun-inst -.Nd instrument source code +.Nd source to source transformation .Sh DESCRIPTION -Warning: .Nm -is not meant to be invoked directly. Instead, it is invoked automatically from +modifies source files found on its command line. +It is usually called from .Xr citrun-wrap 1 . .Pp -Instrumentation is attempted on any C or C++ source files found on the command -line. Source files are matched on suffix, one of: +Command line source files are matched on suffix, one of: .Pp -.Bl -tag -width Ds -offset indent -compact +.Bl -tag -offset indent -compact .It .c .It .cc .It .cpp .It .cxx .El .Pp -When instrumentation is successful modified source files are compiled with -the native command line. -.Sh ENVIRONMENT -.Bl -tag -width Ds -.It Ev CITRUN_PATH -Directory of symlinks named after supported compiler binaries. -.It Ev PATH -Must contain -.Ev CITRUN_PATH . -.El +When +.Nm +is called directly it attempts instrumentation on any source files found on its +command line. +.Pp +When +.Nm +is called from a build command searching +.Ev PATH +for compiler executables it attempts instrumentation on any source files found +on its command line and then executes that command line with modified files in +place. .Sh EXIT STATUS .Ex -std .Sh SEE ALSO diff --git a/man/citrun-wrap.1 b/man/citrun-wrap.1 @@ -1,45 +1,64 @@ -.Dd April 10, 2016 +.\" +.\" Copyright (c) 2016 Kyle Milz <kyle@0x30.net> +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.Dd $Mdocdate: April 10 2016 $ .Dt CITRUN-WRAP 1 .Os .Sh NAME .Nm citrun-wrap -.Nd prepare to see it run +.Nd instrument a build command .Sh SYNOPSIS .Nm .Ar make | jam | gcc | cmake | ... .Sh DESCRIPTION -Adds instrumentation to a build command by intercepting compiler executions and -redirecting them to -.Xr citrun-inst 1 . +Add instrumentation to any source files compiled during a build command. .Pp -Warning: The build command must not use absolute paths to compilers. +The build command must search +.Ev PATH +when finding compiler executables, which must be one of the following: .Pp -The following compiler names are intercepted: -.Pp -.Bl -tag -width Ds -offset indent -compact -.It c++ -.It cc -.It clang -.It clang++ -.It eg++ -.It egcc -.It g++ -.It gcc +.Bl -bullet -offset indent -compact +.It +c++ +.It +cc +.It +clang +.It +clang++ +.It +eg++ +.It +egcc +.It +g++ +.It +gcc .El .Sh EXAMPLES -Let's say that -.Qq program -is written in C, compiled with clang, and built by Make. Then to see +Let .Qq program -run prepend +be written in C, compiled with GCC and built by Make. Prepending .Nm -to the build command: +to the build command adds instrumentation: .Pp .Dl $ citrun-wrap make .Pp -After that finishes +Now see .Qq program -is ready for viewing: +run: .Pp .Dl $ ./program .Sh SEE ALSO