]> git.cameronkatri.com Git - apple_cmds.git/blob - system_cmds/gcore.tproj/options.h
Merge branch 'apple'
[apple_cmds.git] / system_cmds / gcore.tproj / options.h
1 /*
2 * Copyright (c) 2016 Apple Inc. All rights reserved.
3 */
4
5 #include <sys/types.h>
6 #include <compression.h>
7
8 #include <assert.h>
9
10 #ifndef _OPTIONS_H
11 #define _OPTIONS_H
12
13 #if defined(__arm__) || defined(__arm64__)
14 #define RDAR_23744374 1 /* 'true' while not fixed i.e. enable workarounds */
15 #define RDAR_28040018 1 /* 'true' while not fixed i.e. enable workarounds */
16 #endif
17
18 //#define CONFIG_SUBMAP 1 /* include submaps (debugging output) */
19 #define CONFIG_GCORE_MAP 1 /* support 'gcore map' */
20 #define CONFIG_GCORE_CONV 1 /* support 'gcore conv' - new -> old core files */
21 #define CONFIG_GCORE_FREF 1 /* support 'gcore fref' - referenced file list */
22 #define CONFIG_DEBUG 1 /* support '-d' option */
23
24 #ifdef NDEBUG
25 #define poison(a, p, s) /* do nothing */
26 #else
27 #define poison(a, p, s) memset(a, p, s) /* scribble on dying memory */
28 #endif
29
30 struct options {
31 int corpsify; // make a corpse to dump from
32 int suspend; // suspend while dumping
33 int preserve; // preserve the core file, even if there are errors
34 int verbose; // be chatty
35 #ifdef CONFIG_DEBUG
36 int debug; // internal debugging: options accumulate. noisy.
37 #endif
38 int extended; // avoid writing out ro mapped files, compress regions
39 off_t sizebound; // maximum size of the dump
40 size_t chunksize; // max size of a compressed subregion
41 compression_algorithm calgorithm; // algorithm in use
42 size_t ncthresh; // F_NOCACHE enabled *above* this value
43 int allfilerefs; // if set, every mapped file on the root fs is a fileref
44 int dsymforuuid; // Try dsysForUUID to retrieve symbol-rich executable
45 };
46
47 extern const struct options *opt;
48
49 /*
50 * == 0 - not verbose
51 * >= 1 - verbose plus chatty
52 * >= 2 - tabular summaries
53 * >= 3 - all
54 */
55
56 #ifdef CONFIG_DEBUG
57 #define OPTIONS_DEBUG(opt, lvl) ((opt)->debug && (opt)->debug >= (lvl))
58 #else
59 #define OPTIONS_DEBUG(opt, lvl) 0
60 #endif
61
62 #endif /* _OPTIONS_H */