1INTERCEPT(1)                                                      INTERCEPT(1)
2
3
4

NAME

6       intercept - intercept command executions in user space.
7

SYNOPSIS

9       intercept [options] -- [build command]
10

DESCRIPTION

12       For intercepting the compiler executions, intercept uses the LD_PRELOAD
13       or DYLD_INSERT_LIBRARIES mechanisms provided  by  the  dynamic  linker.
14       When the dynamic linker is not working (because the executable is not a
15       dynamically linked executable or security protection disables the link‐
16       er) then intercept uses compiler wrappers to record the compiler calls.
17       The wrapper sends execution report and calls the real  compiler.   (Not
18       only  compilers,  but  linkers,  assemblers  and  other  tools are also
19       wrapped.)
20
21       The reports are collected by the intercept over a gRPC  interface,  and
22       digested into an output JSON file.
23

OPTIONS

25       --version
26              Print version number.
27
28       --help Print help message.
29
30       --verbose
31              Enable verbose logging.
32
33       --output file
34              Specify  output  file.  (Default file name provided.) The output
35              is a command execution list, with some extra  information.   The
36              syntax is detailed in a separate section.
37
38       --force-preload
39              Force to use the dynamic linker method to intercept the children
40              processes.
41
42       --force-wrapper
43              Force to use the compiler wrapper method to intercept the  chil‐
44              dren processes.
45

EXIT STATUS

47       The exit status of the program is the exit status of the build command.
48       Except when the program itself crashes, then it sets to non zero.
49

OUTPUT FILE

51       It’s a JSON file, with the command execution history.  (Plus some meta‐
52       data, that is useful for debugging the application.)
53
54              {
55                "context": {
56                  "host_info": {
57                    "_CS_GNU_LIBC_VERSION": "glibc 2.30",
58                    "_CS_GNU_LIBPTHREAD_VERSION": "NPTL 2.30",
59                    "_CS_PATH": "/usr/bin",
60                    "machine": "x86_64",
61                    "release": "5.5.13-200.fc31.x86_64",
62                    "sysname": "Linux",
63                    "version": "#1 SMP Wed Mar 25 21:55:30 UTC 2020"
64                  },
65                  "intercept": "library preload"
66                },
67                "executions": [
68                  {
69                    "command": {
70                      "arguments": [
71                        "sleep",
72                        "1"
73                      ],
74                      "environment": {
75                        "PATH": "/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin"
76                      },
77                      "program": "/usr/bin/sleep",
78                      "working_dir": "/home/lnagy/Code/Bear.git"
79                    },
80                    "run": {
81                      "events": [
82                        {
83                          "at": "2020-02-16T21:00:00.000Z",
84                          "type": "start"
85                        },
86                        {
87                          "at": "2020-02-16T21:00:00.000Z",
88                          "status": 0,
89                          "type": "stop"
90                        }
91                      ],
92                      "pid": 503092,
93                      "ppid": 503083
94                    }
95                  }
96                ]
97              }
98

TROUBLESHOOTING

100       The  potential problems you can face with are: the build with and with‐
101       out the interception behaves differently (eg.: the build crash with the
102       intercept  tool,  but  succeed  otherwise).  The output is empty and it
103       failed to intercept the children process execution by  the  build  com‐
104       mand.
105
106       There  could be many reasons for any of these failures.  It’s better to
107       consult with the project wiki page for known problems,  before  open  a
108       bug report.
109
110       The  most  common cause for empty outputs is that the build command was
111       not executed any commands.  The reason for that could be,  because  in‐
112       cremental builds not running the compilers if everything is up to date.
113       Remember, intercept is not understanding the  build  file  (eg.:  make‐
114       file), but intercepts the executed commands.
115

SEE ALSO

117       bear(1)
118
120       Copyright  (C)  2012-2021  by  László  Nagy <https://github.com/rizsot
121       to/Bear>
122

AUTHORS

124       László Nagy.
125
126
127
128Bear User Manuals                Sep 14, 2020                     INTERCEPT(1)
Impressum