Deleted Added
full compact
setup.c (288903) setup.c (294849)
1/*-
2 * Copyright 1997 Sean Eric Fagan
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 16 unchanged lines hidden (view full) ---

25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 */
31
32#include <sys/cdefs.h>
1/*-
2 * Copyright 1997 Sean Eric Fagan
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 16 unchanged lines hidden (view full) ---

25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 */
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: head/usr.bin/truss/setup.c 288903 2015-10-05 21:39:07Z bdrewery $");
33__FBSDID("$FreeBSD: head/usr.bin/truss/setup.c 294849 2016-01-26 19:07:09Z jhb $");
34
35/*
36 * Various setup functions for truss. Not the cleanest-written code,
37 * I'm afraid.
38 */
39
40#include <sys/ptrace.h>
41#include <sys/sysctl.h>
42#include <sys/wait.h>
43
44#include <assert.h>
45#include <err.h>
46#include <errno.h>
47#include <signal.h>
48#include <stdint.h>
49#include <stdio.h>
50#include <stdlib.h>
51#include <string.h>
34
35/*
36 * Various setup functions for truss. Not the cleanest-written code,
37 * I'm afraid.
38 */
39
40#include <sys/ptrace.h>
41#include <sys/sysctl.h>
42#include <sys/wait.h>
43
44#include <assert.h>
45#include <err.h>
46#include <errno.h>
47#include <signal.h>
48#include <stdint.h>
49#include <stdio.h>
50#include <stdlib.h>
51#include <string.h>
52#include <sysdecode.h>
52#include <time.h>
53#include <unistd.h>
54
55#include "truss.h"
56#include "syscall.h"
57#include "extern.h"
58
59SET_DECLARE(procabi, struct procabi);

--- 270 unchanged lines hidden (view full) ---

330 t = info->curthread;
331 alloc_syscall(t, pl);
332 narg = MIN(pl->pl_syscall_narg, nitems(t->cs.args));
333 if (narg != 0 && t->proc->abi->fetch_args(info, narg) != 0) {
334 free_syscall(t);
335 return;
336 }
337
53#include <time.h>
54#include <unistd.h>
55
56#include "truss.h"
57#include "syscall.h"
58#include "extern.h"
59
60SET_DECLARE(procabi, struct procabi);

--- 270 unchanged lines hidden (view full) ---

331 t = info->curthread;
332 alloc_syscall(t, pl);
333 narg = MIN(pl->pl_syscall_narg, nitems(t->cs.args));
334 if (narg != 0 && t->proc->abi->fetch_args(info, narg) != 0) {
335 free_syscall(t);
336 return;
337 }
338
338 if (t->cs.number >= 0 && t->cs.number < t->proc->abi->nsyscalls)
339 t->cs.name = t->proc->abi->syscallnames[t->cs.number];
339 t->cs.name = sysdecode_syscallname(t->proc->abi->abi, t->cs.number);
340 if (t->cs.name == NULL)
341 fprintf(info->outfile, "-- UNKNOWN %s SYSCALL %d --\n",
342 t->proc->abi->type, t->cs.number);
343
344 sc = get_syscall(t->cs.name, narg);
345 t->cs.nargs = sc->nargs;
346 assert(sc->nargs <= nitems(t->cs.s_args));
347

--- 245 unchanged lines hidden ---
340 if (t->cs.name == NULL)
341 fprintf(info->outfile, "-- UNKNOWN %s SYSCALL %d --\n",
342 t->proc->abi->type, t->cs.number);
343
344 sc = get_syscall(t->cs.name, narg);
345 t->cs.nargs = sc->nargs;
346 assert(sc->nargs <= nitems(t->cs.s_args));
347

--- 245 unchanged lines hidden ---