njn | 2024234 | 2005-05-16 23:31:24 +0000 | [diff] [blame] | 1 | |
| 2 | /*--------------------------------------------------------------------*/ |
| 3 | /*--- Command line options. pub_core_options.h ---*/ |
| 4 | /*--------------------------------------------------------------------*/ |
| 5 | |
| 6 | /* |
| 7 | This file is part of Valgrind, a dynamic binary instrumentation |
| 8 | framework. |
| 9 | |
Elliott Hughes | ed39800 | 2017-06-21 14:41:24 -0700 | [diff] [blame^] | 10 | Copyright (C) 2000-2017 Julian Seward |
njn | 2024234 | 2005-05-16 23:31:24 +0000 | [diff] [blame] | 11 | jseward@acm.org |
| 12 | |
| 13 | This program is free software; you can redistribute it and/or |
| 14 | modify it under the terms of the GNU General Public License as |
| 15 | published by the Free Software Foundation; either version 2 of the |
| 16 | License, or (at your option) any later version. |
| 17 | |
| 18 | This program is distributed in the hope that it will be useful, but |
| 19 | WITHOUT ANY WARRANTY; without even the implied warranty of |
| 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 21 | General Public License for more details. |
| 22 | |
| 23 | You should have received a copy of the GNU General Public License |
| 24 | along with this program; if not, write to the Free Software |
| 25 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
| 26 | 02111-1307, USA. |
| 27 | |
| 28 | The GNU General Public License is contained in the file COPYING. |
| 29 | */ |
| 30 | |
| 31 | #ifndef __PUB_CORE_OPTIONS_H |
| 32 | #define __PUB_CORE_OPTIONS_H |
| 33 | |
| 34 | //-------------------------------------------------------------------- |
| 35 | // PURPOSE: This module holds the variables for all command line options, |
| 36 | // plus some functions and macros for manipulating them. Almost every |
| 37 | // other module imports this one, if only for VG_(clo_verbosity). |
| 38 | //-------------------------------------------------------------------- |
njn | 2024234 | 2005-05-16 23:31:24 +0000 | [diff] [blame] | 39 | #include "pub_tool_options.h" |
florian | 7931627 | 2014-10-07 18:36:28 +0000 | [diff] [blame] | 40 | #include "pub_core_xarray.h" |
sewardj | 14cdbf8 | 2010-10-12 00:44:05 +0000 | [diff] [blame] | 41 | |
Elliott Hughes | ed39800 | 2017-06-21 14:41:24 -0700 | [diff] [blame^] | 42 | /* Valgrind tool name. Defaults to "memcheck". */ |
| 43 | extern const HChar *VG_(clo_toolname); |
| 44 | |
njn | 2024234 | 2005-05-16 23:31:24 +0000 | [diff] [blame] | 45 | /* Should we stop collecting errors if too many appear? default: YES */ |
| 46 | extern Bool VG_(clo_error_limit); |
sewardj | b977908 | 2006-05-12 23:50:15 +0000 | [diff] [blame] | 47 | /* Alternative exit code to hand to parent if errors were found. |
| 48 | default: 0 (no, return the application's exit code in the normal |
| 49 | way. */ |
| 50 | extern Int VG_(clo_error_exitcode); |
sewardj | 3b29048 | 2011-05-06 21:02:55 +0000 | [diff] [blame] | 51 | |
philippe | 7b3d356 | 2014-11-12 19:43:29 +0000 | [diff] [blame] | 52 | /* Markers used to mark the begin/end of an error, when errors are |
| 53 | printed in textual (non xml) format. |
| 54 | [0] is the error begin marker, [1] is the error end marker. |
| 55 | default: no markers. */ |
| 56 | extern HChar *VG_(clo_error_markers)[2]; |
| 57 | |
sewardj | 3b29048 | 2011-05-06 21:02:55 +0000 | [diff] [blame] | 58 | typedef |
| 59 | enum { |
| 60 | Vg_VgdbNo, // Do not activate gdbserver. |
| 61 | Vg_VgdbYes, // Activate gdbserver (default). |
| 62 | Vg_VgdbFull, // ACtivate gdbserver in full mode, allowing |
| 63 | // a precise handling of watchpoints and single stepping |
| 64 | // at any moment. |
| 65 | } |
| 66 | VgVgdb; |
| 67 | /* if != Vg_VgdbNo, allows valgrind to serve vgdb/gdb. */ |
| 68 | extern VgVgdb VG_(clo_vgdb); |
| 69 | /* if > 0, checks every VG_(clo_vgdb_poll) BBS if vgdb wants to be served. */ |
| 70 | extern Int VG_(clo_vgdb_poll); |
philippe | cffe2a5 | 2014-01-11 13:56:48 +0000 | [diff] [blame] | 71 | |
philippe | 180a750 | 2014-04-20 13:41:10 +0000 | [diff] [blame] | 72 | /* Specify when Valgrind gdbserver stops the execution and wait |
| 73 | for a GDB to connect. */ |
| 74 | typedef |
| 75 | enum { // Stop : |
| 76 | VgdbStopAt_Startup, // just before the client starts to execute. |
| 77 | VgdbStopAt_Exit, // just before the client exits. |
| 78 | VgdbStopAt_ValgrindAbExit // on abnormal valgrind exit. |
| 79 | } |
| 80 | VgdbStopAt; |
| 81 | // Build mask to check or set VgdbStop_At a membership |
| 82 | #define VgdbStopAt2S(a) (1 << (a)) |
| 83 | // VgdbStopAt a is member of the Set s ? |
| 84 | #define VgdbStopAtiS(a,s) ((s) & VgdbStopAt2S(a)) |
philippe | 180a750 | 2014-04-20 13:41:10 +0000 | [diff] [blame] | 85 | extern UInt VG_(clo_vgdb_stop_at); // A set of VgdbStopAt reasons. |
| 86 | |
sewardj | 3b29048 | 2011-05-06 21:02:55 +0000 | [diff] [blame] | 87 | /* prefix for the named pipes (FIFOs) used by vgdb/gdb to communicate with valgrind */ |
philippe | cffe2a5 | 2014-01-11 13:56:48 +0000 | [diff] [blame] | 88 | extern const HChar *VG_(clo_vgdb_prefix); |
| 89 | |
sewardj | 3b29048 | 2011-05-06 21:02:55 +0000 | [diff] [blame] | 90 | /* if True, gdbserver in valgrind will expose a target description containing |
| 91 | shadow registers */ |
| 92 | extern Bool VG_(clo_vgdb_shadow_registers); |
sewardj | 3b29048 | 2011-05-06 21:02:55 +0000 | [diff] [blame] | 93 | |
njn | 2024234 | 2005-05-16 23:31:24 +0000 | [diff] [blame] | 94 | /* Generating a suppression for each error? default: 0 (NO) |
| 95 | Other values: 1 (yes, but ask user), 2 (yes, don't ask user) */ |
sewardj | b977908 | 2006-05-12 23:50:15 +0000 | [diff] [blame] | 96 | extern Int VG_(clo_gen_suppressions); |
njn | 2024234 | 2005-05-16 23:31:24 +0000 | [diff] [blame] | 97 | /* Sanity-check level: 0 = none, 1 (default), > 1 = expensive. */ |
| 98 | extern Int VG_(clo_sanity_level); |
| 99 | /* Automatically attempt to demangle C++ names? default: YES */ |
| 100 | extern Bool VG_(clo_demangle); |
philippe | 1e470b5 | 2012-05-11 19:33:46 +0000 | [diff] [blame] | 101 | /* Soname synonyms : a string containing a list of pairs |
| 102 | xxxxx=yyyyy separated by commas. |
| 103 | E.g. --soname-synonyms=somalloc=libtcmalloc*.so*,solibtruc=NONE */ |
florian | 19f91bb | 2012-11-10 22:29:54 +0000 | [diff] [blame] | 104 | extern const HChar* VG_(clo_soname_synonyms); |
philippe | b314d10 | 2014-11-07 22:16:27 +0000 | [diff] [blame] | 105 | /* Valgrind-ise child processes (follow execve)? default : NO */ |
njn | 2024234 | 2005-05-16 23:31:24 +0000 | [diff] [blame] | 106 | extern Bool VG_(clo_trace_children); |
sewardj | 0642127 | 2009-11-05 08:55:13 +0000 | [diff] [blame] | 107 | /* String containing comma-separated patterns for executable names |
| 108 | that should not be traced into even when --trace-children=yes */ |
florian | 19f91bb | 2012-11-10 22:29:54 +0000 | [diff] [blame] | 109 | extern const HChar* VG_(clo_trace_children_skip); |
sewardj | 9ab64a4 | 2010-12-06 11:40:04 +0000 | [diff] [blame] | 110 | /* The same as VG_(clo_trace_children), except that these patterns are |
| 111 | tested against the arguments for child processes, rather than the |
| 112 | executable name. */ |
florian | 19f91bb | 2012-11-10 22:29:54 +0000 | [diff] [blame] | 113 | extern const HChar* VG_(clo_trace_children_skip_by_arg); |
sewardj | 6e31f80 | 2007-11-17 22:29:25 +0000 | [diff] [blame] | 114 | /* After a fork, the child's output can become confusingly |
| 115 | intermingled with the parent's output. This is especially |
| 116 | problematic when VG_(clo_xml) is True. Setting |
| 117 | VG_(clo_child_silent_after_fork) causes children to fall silent |
sewardj | 738856f | 2009-07-15 14:48:32 +0000 | [diff] [blame] | 118 | after fork() calls. Although note they become un-silent again |
| 119 | after the subsequent exec(). */ |
sewardj | 6e31f80 | 2007-11-17 22:29:25 +0000 | [diff] [blame] | 120 | extern Bool VG_(clo_child_silent_after_fork); |
njn | 2024234 | 2005-05-16 23:31:24 +0000 | [diff] [blame] | 121 | |
sewardj | 738856f | 2009-07-15 14:48:32 +0000 | [diff] [blame] | 122 | /* If the user specified --log-file=STR and/or --xml-file=STR, these |
Elliott Hughes | ed39800 | 2017-06-21 14:41:24 -0700 | [diff] [blame^] | 123 | hold STR before expansion. */ |
| 124 | extern const HChar *VG_(clo_log_fname_unexpanded); |
| 125 | extern const HChar *VG_(clo_xml_fname_unexpanded); |
njn | 2024234 | 2005-05-16 23:31:24 +0000 | [diff] [blame] | 126 | |
| 127 | /* Add timestamps to log messages? default: NO */ |
| 128 | extern Bool VG_(clo_time_stamp); |
| 129 | |
| 130 | /* The file descriptor to read for input. default: 0 == stdin */ |
| 131 | extern Int VG_(clo_input_fd); |
sewardj | f9ebc39 | 2010-05-09 22:30:43 +0000 | [diff] [blame] | 132 | |
bart | 2c68e3e | 2014-06-22 10:11:59 +0000 | [diff] [blame] | 133 | /* Whether or not to load the default suppressions. */ |
| 134 | extern Bool VG_(clo_default_supp); |
florian | 7931627 | 2014-10-07 18:36:28 +0000 | [diff] [blame] | 135 | |
njn | 2024234 | 2005-05-16 23:31:24 +0000 | [diff] [blame] | 136 | /* The names of the suppression files. */ |
florian | 7931627 | 2014-10-07 18:36:28 +0000 | [diff] [blame] | 137 | extern XArray *VG_(clo_suppressions); |
njn | 2024234 | 2005-05-16 23:31:24 +0000 | [diff] [blame] | 138 | |
sewardj | 14cdbf8 | 2010-10-12 00:44:05 +0000 | [diff] [blame] | 139 | /* An array of strings harvested from --fullpath-after= flags. */ |
florian | 7931627 | 2014-10-07 18:36:28 +0000 | [diff] [blame] | 140 | extern XArray *VG_(clo_fullpath_after); |
sewardj | 14cdbf8 | 2010-10-12 00:44:05 +0000 | [diff] [blame] | 141 | |
sewardj | 8b6573d | 2012-12-05 22:15:14 +0000 | [diff] [blame] | 142 | /* Full path to additional path to search for debug symbols */ |
sewardj | 71826f7 | 2012-12-06 18:23:20 +0000 | [diff] [blame] | 143 | extern const HChar* VG_(clo_extra_debuginfo_path); |
sewardj | 8b6573d | 2012-12-05 22:15:14 +0000 | [diff] [blame] | 144 | |
sewardj | 5d616df | 2013-07-02 08:07:15 +0000 | [diff] [blame] | 145 | /* Address of a debuginfo server to use. Either an IPv4 address of |
| 146 | the form "d.d.d.d" or that plus a port spec, hence of the form |
| 147 | "d.d.d.d:d", where d is one or more digits. */ |
| 148 | extern const HChar* VG_(clo_debuginfo_server); |
| 149 | |
| 150 | /* Do we allow reading debuginfo from debuginfo objects that don't |
| 151 | match (in some sense) the main object? This is dangerous, so the |
| 152 | default is NO (False). In any case it applies only to objects |
| 153 | found either in _extra_debuginfo_path or via the |
| 154 | _debuginfo_server. */ |
| 155 | extern Bool VG_(clo_allow_mismatched_debuginfo); |
njn | 2024234 | 2005-05-16 23:31:24 +0000 | [diff] [blame] | 156 | |
| 157 | /* DEBUG: print generated code? default: 00000000 ( == NO ) */ |
| 158 | extern UChar VG_(clo_trace_flags); |
sewardj | 17c5e2e | 2012-12-28 09:12:14 +0000 | [diff] [blame] | 159 | |
| 160 | /* DEBUG: do SB profiling? default: False (== NO). NOTE: does not |
| 161 | have an associated command line flag. Is set to True whenever |
| 162 | --profile-flags= is specified. */ |
| 163 | extern Bool VG_(clo_profyle_sbs); |
| 164 | /* DEBUG: if doing SB profiling, provides bits for which JIT stages |
| 165 | are shown. Same meaning as for clo_trace_flags. default: zero (== |
| 166 | show block counts only) */ |
| 167 | extern UChar VG_(clo_profyle_flags); |
| 168 | /* DEBUG: if doing SB profiling, dump blocks and zero counters after |
| 169 | this-many back edges (event checks). default: zero (== show |
| 170 | profiling results only at the end of the run. */ |
| 171 | extern ULong VG_(clo_profyle_interval); |
| 172 | |
florian | 29e022d | 2012-07-02 21:13:34 +0000 | [diff] [blame] | 173 | /* DEBUG: if tracing codegen, be quiet until after this bb */ |
njn | 2024234 | 2005-05-16 23:31:24 +0000 | [diff] [blame] | 174 | extern Int VG_(clo_trace_notbelow); |
florian | 29e022d | 2012-07-02 21:13:34 +0000 | [diff] [blame] | 175 | /* DEBUG: if tracing codegen, be quiet after this bb */ |
| 176 | extern Int VG_(clo_trace_notabove); |
njn | 2024234 | 2005-05-16 23:31:24 +0000 | [diff] [blame] | 177 | /* DEBUG: print system calls? default: NO */ |
| 178 | extern Bool VG_(clo_trace_syscalls); |
| 179 | /* DEBUG: print signal details? default: NO */ |
| 180 | extern Bool VG_(clo_trace_signals); |
| 181 | /* DEBUG: print symtab details? default: NO */ |
| 182 | extern Bool VG_(clo_trace_symtab); |
sewardj | f767d96 | 2007-02-12 17:47:14 +0000 | [diff] [blame] | 183 | /* DEBUG: restrict symtab etc details to object name pattern. Default: "*" */ |
florian | 19f91bb | 2012-11-10 22:29:54 +0000 | [diff] [blame] | 184 | extern const HChar* VG_(clo_trace_symtab_patt); |
njn | 2024234 | 2005-05-16 23:31:24 +0000 | [diff] [blame] | 185 | /* DEBUG: print call-frame-info details? default: NO */ |
| 186 | extern Bool VG_(clo_trace_cfi); |
sewardj | f767d96 | 2007-02-12 17:47:14 +0000 | [diff] [blame] | 187 | /* DEBUG: mimic /usr/bin/readelf --syms? default: NO */ |
| 188 | extern Bool VG_(clo_debug_dump_syms); |
| 189 | /* DEBUG: mimic /usr/bin/readelf --debug-dump=line? default: NO */ |
| 190 | extern Bool VG_(clo_debug_dump_line); |
| 191 | /* DEBUG: mimic /usr/bin/readelf --debug-dump=frames? default: NO */ |
| 192 | extern Bool VG_(clo_debug_dump_frames); |
njn | 2024234 | 2005-05-16 23:31:24 +0000 | [diff] [blame] | 193 | /* DEBUG: print redirection details? default: NO */ |
| 194 | extern Bool VG_(clo_trace_redir); |
bart | 78bfc71 | 2011-12-08 16:14:59 +0000 | [diff] [blame] | 195 | /* Enable fair scheduling on multicore systems? default: NO */ |
| 196 | enum FairSchedType { disable_fair_sched, enable_fair_sched, try_fair_sched }; |
| 197 | extern enum FairSchedType VG_(clo_fair_sched); |
njn | 2024234 | 2005-05-16 23:31:24 +0000 | [diff] [blame] | 198 | /* DEBUG: print thread scheduling events? default: NO */ |
| 199 | extern Bool VG_(clo_trace_sched); |
sewardj | 9c606bd | 2008-09-18 18:12:50 +0000 | [diff] [blame] | 200 | /* DEBUG: do heap profiling? default: NO */ |
| 201 | extern Bool VG_(clo_profile_heap); |
philippe | d99c26a | 2012-07-31 22:17:28 +0000 | [diff] [blame] | 202 | #define MAX_REDZONE_SZB 128 |
| 203 | // Maximum for the default values for core arenas and for client |
| 204 | // arena given by the tool. |
| 205 | // 128 is no special figure, just something not too big |
| 206 | #define MAX_CLO_REDZONE_SZB 4096 |
| 207 | // We allow the user to increase the redzone size to 4Kb : |
| 208 | // This allows "off by one" in an array of pages to be detected. |
| 209 | #define CORE_REDZONE_DEFAULT_SZB 4 |
| 210 | extern Int VG_(clo_core_redzone_size); |
| 211 | // VG_(clo_redzone_size) has default value -1, indicating to keep |
| 212 | // the tool provided value. |
sewardj | 9c606bd | 2008-09-18 18:12:50 +0000 | [diff] [blame] | 213 | /* DEBUG: display gory details for the k'th most popular error. |
| 214 | default: Infinity. */ |
njn | 2024234 | 2005-05-16 23:31:24 +0000 | [diff] [blame] | 215 | extern Int VG_(clo_dump_error); |
philippe | ec905f7 | 2014-08-17 20:03:51 +0000 | [diff] [blame] | 216 | |
njn | 2024234 | 2005-05-16 23:31:24 +0000 | [diff] [blame] | 217 | /* Engage miscellaneous weird hacks needed for some progs. */ |
philippe | ec905f7 | 2014-08-17 20:03:51 +0000 | [diff] [blame] | 218 | typedef |
| 219 | enum { |
philippe | ec905f7 | 2014-08-17 20:03:51 +0000 | [diff] [blame] | 220 | SimHint_lax_ioctls, |
sewardj | 8eb8bab | 2015-07-21 14:44:28 +0000 | [diff] [blame] | 221 | SimHint_lax_doors, |
philippe | 9848690 | 2014-08-19 22:46:44 +0000 | [diff] [blame] | 222 | SimHint_fuse_compatible, |
| 223 | SimHint_enable_outer, |
| 224 | SimHint_no_inner_prefix, |
Elliott Hughes | ed39800 | 2017-06-21 14:41:24 -0700 | [diff] [blame^] | 225 | SimHint_no_nptl_pthread_stackcache, |
| 226 | SimHint_fallback_llsc |
philippe | ec905f7 | 2014-08-17 20:03:51 +0000 | [diff] [blame] | 227 | } |
| 228 | SimHint; |
| 229 | |
| 230 | // Build mask to check or set SimHint a membership |
| 231 | #define SimHint2S(a) (1 << (a)) |
| 232 | // SimHint h is member of the Set s ? |
Elliott Hughes | ed39800 | 2017-06-21 14:41:24 -0700 | [diff] [blame^] | 233 | #define SimHintiS(h,s) (((s) & SimHint2S(h)) != 0) |
philippe | ec905f7 | 2014-08-17 20:03:51 +0000 | [diff] [blame] | 234 | extern UInt VG_(clo_sim_hints); |
| 235 | |
sewardj | 41ded2c | 2006-10-17 01:34:57 +0000 | [diff] [blame] | 236 | /* Show symbols in the form 'name+offset' ? Default: NO */ |
| 237 | extern Bool VG_(clo_sym_offsets); |
philippe | a0a7393 | 2014-06-15 15:42:20 +0000 | [diff] [blame] | 238 | /* Read DWARF3 inline info ? */ |
| 239 | extern Bool VG_(clo_read_inline_info); |
sewardj | b8b79ad | 2008-03-03 01:35:41 +0000 | [diff] [blame] | 240 | /* Read DWARF3 variable info even if tool doesn't ask for it? */ |
| 241 | extern Bool VG_(clo_read_var_info); |
bart | 5dd0190 | 2010-08-31 15:18:32 +0000 | [diff] [blame] | 242 | /* Which prefix to strip from full source file paths, if any. */ |
florian | 19f91bb | 2012-11-10 22:29:54 +0000 | [diff] [blame] | 243 | extern const HChar* VG_(clo_prefix_to_strip); |
njn | 2024234 | 2005-05-16 23:31:24 +0000 | [diff] [blame] | 244 | |
sewardj | f9ebc39 | 2010-05-09 22:30:43 +0000 | [diff] [blame] | 245 | /* An array of strings harvested from --require-text-symbol= |
| 246 | flags. |
| 247 | |
| 248 | Each string specifies a pair: a soname pattern and a text symbol |
| 249 | name pattern, separated by a colon. The patterns can be written |
| 250 | using the normal "?" and "*" wildcards. For example: |
| 251 | ":*libc.so*:foo?bar". |
| 252 | |
| 253 | These flags take effect when reading debuginfo from objects. If an |
| 254 | object is loaded and the object's soname matches the soname |
| 255 | component of one of the specified pairs, then Valgrind will examine |
| 256 | all the text symbol names in the object. If none of them match the |
| 257 | symbol name component of that same specification, then the run is |
| 258 | aborted, with an error message. |
| 259 | |
| 260 | The purpose of this is to support reliable usage of marked-up |
| 261 | libraries. For example, suppose we have a version of GCC's |
| 262 | libgomp.so which has been marked up with annotations to support |
| 263 | Helgrind. It is only too easy and confusing to load the 'wrong' |
| 264 | libgomp.so into the application. So the idea is: add a text symbol |
| 265 | in the marked-up library (eg), "annotated_for_helgrind_3_6", and |
| 266 | then give the flag |
| 267 | |
| 268 | --require-text-symbol=:*libgomp*so*:annotated_for_helgrind_3_6 |
| 269 | |
| 270 | so that when libgomp.so is loaded, we scan the symbol table, and if |
| 271 | the symbol isn't present the run is aborted, rather than continuing |
| 272 | silently with the un-marked-up library. Note that you should put |
| 273 | the entire flag in quotes to stop shells messing up the * and ? |
| 274 | wildcards. */ |
florian | 7931627 | 2014-10-07 18:36:28 +0000 | [diff] [blame] | 275 | extern XArray *VG_(clo_req_tsyms); |
sewardj | f9ebc39 | 2010-05-09 22:30:43 +0000 | [diff] [blame] | 276 | |
njn | 2024234 | 2005-05-16 23:31:24 +0000 | [diff] [blame] | 277 | /* Track open file descriptors? */ |
| 278 | extern Bool VG_(clo_track_fds); |
| 279 | |
| 280 | /* Should we run __libc_freeres at exit? Sometimes causes crashes. |
| 281 | Default: YES. Note this is subservient to VG_(needs).libc_freeres; |
sewardj | 19617ae | 2005-10-20 01:09:57 +0000 | [diff] [blame] | 282 | if the latter says False, then the setting of VG_(clo_run_libc_freeres) |
njn | 2024234 | 2005-05-16 23:31:24 +0000 | [diff] [blame] | 283 | is ignored. Ie if a tool says no, I don't want this to run, that |
| 284 | cannot be overridden from the command line. */ |
| 285 | extern Bool VG_(clo_run_libc_freeres); |
njn | 2024234 | 2005-05-16 23:31:24 +0000 | [diff] [blame] | 286 | |
Elliott Hughes | a0664b9 | 2017-04-18 17:46:52 -0700 | [diff] [blame] | 287 | /* Should we run __gnu_cxx::__freeres at exit for C++ programs? |
| 288 | Default: YES. Note this is subservient to VG_(needs).cxx_freeres; |
| 289 | if the latter says False, then the setting of VG_(clo_run_cxx_freeres) |
| 290 | is ignored. Ie if a tool says no, I don't want this to run, that |
| 291 | cannot be overridden from the command line. */ |
| 292 | extern Bool VG_(clo_run_cxx_freeres); |
| 293 | |
njn | 2024234 | 2005-05-16 23:31:24 +0000 | [diff] [blame] | 294 | /* Should we show VEX emulation warnings? Default: NO */ |
| 295 | extern Bool VG_(clo_show_emwarns); |
| 296 | |
| 297 | /* How much does the stack pointer have to change before tools |
sewardj | 91b470c | 2007-08-28 17:03:01 +0000 | [diff] [blame] | 298 | consider a stack switch to have happened? Default: 2000000 bytes |
| 299 | NB: must be host-word-sized to be correct (hence Word). */ |
| 300 | extern Word VG_(clo_max_stackframe); |
sewardj | 95d86c0 | 2007-12-18 01:49:23 +0000 | [diff] [blame] | 301 | /* How large should Valgrind allow the primary thread's guest stack to |
| 302 | be? */ |
| 303 | extern Word VG_(clo_main_stacksize); |
njn | 2024234 | 2005-05-16 23:31:24 +0000 | [diff] [blame] | 304 | |
florian | 1e802b6 | 2015-02-13 19:08:26 +0000 | [diff] [blame] | 305 | /* The maximum number of threads we support. */ |
| 306 | #define MAX_THREADS_DEFAULT 500 |
| 307 | extern UInt VG_(clo_max_threads); |
| 308 | |
philippe | 4620765 | 2013-01-20 17:11:58 +0000 | [diff] [blame] | 309 | /* If the same IP is found twice in a backtrace in a sequence of max |
| 310 | VG_(clo_merge_recursive_frames) frames, then the recursive call |
| 311 | is merged in the backtrace. |
| 312 | Note also that the merge is done during unwinding, to obtain |
| 313 | an much as possible significant backtrace. |
| 314 | Note that the value is changeable by a gdbsrv command. */ |
| 315 | extern Int VG_(clo_merge_recursive_frames); |
| 316 | |
philippe | 8e1bee4 | 2013-10-18 00:08:20 +0000 | [diff] [blame] | 317 | /* Max number of sectors that will be used by the translation code cache. */ |
| 318 | extern UInt VG_(clo_num_transtab_sectors); |
| 319 | |
philippe | 924c852 | 2015-03-15 12:24:19 +0000 | [diff] [blame] | 320 | /* Average size of a transtab code entry. 0 means to use the tool |
| 321 | provided default. */ |
| 322 | extern UInt VG_(clo_avg_transtab_entry_size); |
| 323 | |
philippe | e4d7812 | 2014-04-20 14:20:37 +0000 | [diff] [blame] | 324 | /* Only client requested fixed mapping can be done below |
| 325 | VG_(clo_aspacem_minAddr). */ |
| 326 | extern Addr VG_(clo_aspacem_minAddr); |
| 327 | |
philippe | d0720e4 | 2015-03-12 20:43:46 +0000 | [diff] [blame] | 328 | /* How large the Valgrind thread stacks should be. |
| 329 | Will be rounded up to a page.. */ |
| 330 | extern Word VG_(clo_valgrind_stacksize); |
| 331 | |
njn | 2024234 | 2005-05-16 23:31:24 +0000 | [diff] [blame] | 332 | /* Delay startup to allow GDB to be attached? Default: NO */ |
| 333 | extern Bool VG_(clo_wait_for_gdb); |
| 334 | |
sewardj | 26412bd | 2005-07-07 10:05:05 +0000 | [diff] [blame] | 335 | /* To what extent should self-checking translations be made? These |
| 336 | are needed to deal with self-modifying code on uncooperative |
| 337 | platforms. */ |
| 338 | typedef |
| 339 | enum { |
| 340 | Vg_SmcNone, // never generate self-checking translations |
| 341 | Vg_SmcStack, // generate s-c-t's for code found in stacks |
sewardj | 26412bd | 2005-07-07 10:05:05 +0000 | [diff] [blame] | 342 | // (this is the default) |
sewardj | 6dbcc63 | 2011-06-07 21:39:28 +0000 | [diff] [blame] | 343 | Vg_SmcAll, // make all translations self-checking. |
| 344 | Vg_SmcAllNonFile // make all translations derived from |
| 345 | // non-file-backed memory self checking |
sewardj | 26412bd | 2005-07-07 10:05:05 +0000 | [diff] [blame] | 346 | } |
| 347 | VgSmc; |
| 348 | |
sewardj | ce5a566 | 2005-10-06 03:19:49 +0000 | [diff] [blame] | 349 | /* Describe extent to which self-modifying-code should be |
| 350 | auto-detected. */ |
sewardj | 6c3a219 | 2005-07-24 07:00:45 +0000 | [diff] [blame] | 351 | extern VgSmc VG_(clo_smc_check); |
sewardj | 26412bd | 2005-07-07 10:05:05 +0000 | [diff] [blame] | 352 | |
philippe | ec905f7 | 2014-08-17 20:03:51 +0000 | [diff] [blame] | 353 | /* A set of minor kernel variants, |
sewardj | ce5a566 | 2005-10-06 03:19:49 +0000 | [diff] [blame] | 354 | so they can be properly handled by m_syswrap. */ |
sewardj | 4450a0e | 2014-09-03 15:19:25 +0000 | [diff] [blame] | 355 | typedef |
| 356 | enum { |
| 357 | KernelVariant_bproc, |
sewardj | 124e56d | 2014-09-06 14:45:12 +0000 | [diff] [blame] | 358 | KernelVariant_android_no_hw_tls, |
sewardj | 4450a0e | 2014-09-03 15:19:25 +0000 | [diff] [blame] | 359 | KernelVariant_android_gpu_sgx5xx, |
| 360 | KernelVariant_android_gpu_adreno3xx |
philippe | ec905f7 | 2014-08-17 20:03:51 +0000 | [diff] [blame] | 361 | } |
| 362 | KernelVariant; |
| 363 | // Build mask to check or set KernelVariant a membership |
| 364 | #define KernelVariant2S(v) (1 << (v)) |
| 365 | // KernelVariant v is member of the Set s ? |
| 366 | #define KernelVariantiS(v,s) ((s) & KernelVariant2S(v)) |
| 367 | extern UInt VG_(clo_kernel_variant); |
sewardj | 26412bd | 2005-07-07 10:05:05 +0000 | [diff] [blame] | 368 | |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 369 | /* Darwin-specific: automatically run /usr/bin/dsymutil to update |
| 370 | .dSYM directories as necessary? */ |
njn | 97db761 | 2009-08-04 02:32:55 +0000 | [diff] [blame] | 371 | extern Bool VG_(clo_dsymutil); |
njn | f76d27a | 2009-05-28 01:53:07 +0000 | [diff] [blame] | 372 | |
sewardj | 0642127 | 2009-11-05 08:55:13 +0000 | [diff] [blame] | 373 | /* Should we trace into this child executable (across execve etc) ? |
sewardj | 9ab64a4 | 2010-12-06 11:40:04 +0000 | [diff] [blame] | 374 | This involves considering --trace-children=, |
| 375 | --trace-children-skip=, --trace-children-skip-by-arg=, and the name |
| 376 | of the executable. 'child_argv' must not include the name of the |
| 377 | executable itself; iow child_argv[0] must be the first arg, if any, |
| 378 | for the child. */ |
florian | 518850b | 2014-10-22 22:25:30 +0000 | [diff] [blame] | 379 | extern Bool VG_(should_we_trace_this_child) ( const HChar* child_exe_name, |
| 380 | const HChar** child_argv ); |
sewardj | 63d1c00 | 2006-10-19 17:31:37 +0000 | [diff] [blame] | 381 | |
sewardj | c30cd9b | 2012-12-06 18:08:54 +0000 | [diff] [blame] | 382 | /* Whether illegal instructions should be reported/diagnosed. |
| 383 | Can be explicitly set through --sigill-diagnostics otherwise |
| 384 | depends on verbosity (False if -q). */ |
| 385 | extern Bool VG_(clo_sigill_diag); |
| 386 | |
sewardj | 49984ea | 2013-10-18 13:21:26 +0000 | [diff] [blame] | 387 | /* Unwind using stack scanning (a nasty hack at the best of times) |
| 388 | when the normal CFI/FP-chain scan fails. If the number of |
| 389 | "normally" recovered frames is below this number, stack scanning |
| 390 | will be used (on platforms on which it is supported, currently only |
| 391 | arm-linux). The default value of zero has the effect of disabling |
| 392 | stack scanning. Default: zero*/ |
| 393 | extern UInt VG_(clo_unw_stack_scan_thresh); |
| 394 | |
| 395 | /* If stack scanning is used, this is how many frames it may recover. |
| 396 | Since it tends to pick up a lot of junk, this value is set pretty |
| 397 | low by default. Default: 5 */ |
| 398 | extern UInt VG_(clo_unw_stack_scan_frames); |
| 399 | |
sewardj | 67f7c03 | 2014-10-23 19:48:01 +0000 | [diff] [blame] | 400 | /* Controls the resync-filter on MacOS. Has no effect on Linux. |
| 401 | 0=disabled [default on Linux] "no" |
| 402 | 1=enabled [default on MacOS] "yes" |
| 403 | 2=enabled and verbose. "verbose" */ |
| 404 | extern UInt VG_(clo_resync_filter); |
| 405 | |
njn | 2024234 | 2005-05-16 23:31:24 +0000 | [diff] [blame] | 406 | #endif // __PUB_CORE_OPTIONS_H |
| 407 | |
| 408 | /*--------------------------------------------------------------------*/ |
| 409 | /*--- end ---*/ |
| 410 | /*--------------------------------------------------------------------*/ |