blob: b24ad94ffe18d8c264fb27cc7336c6729c94ea8d [file] [log] [blame]
njn20242342005-05-16 23:31:24 +00001
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
10 Copyright (C) 2000-2005 Julian Seward
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//--------------------------------------------------------------------
39
40#include "pub_tool_options.h"
41
njn20242342005-05-16 23:31:24 +000042/* The max number of suppression files. */
43#define VG_CLO_MAX_SFILES 10
44
45/* Vex iropt control */
46extern VexControl VG_(clo_vex_control);
47/* Should we stop collecting errors if too many appear? default: YES */
48extern Bool VG_(clo_error_limit);
49/* Enquire about whether to attach to a debugger at errors? default: NO */
50extern Bool VG_(clo_db_attach);
51/* The debugger command? default: whatever gdb ./configure found */
52extern Char* VG_(clo_db_command);
53/* Generating a suppression for each error? default: 0 (NO)
54 Other values: 1 (yes, but ask user), 2 (yes, don't ask user) */
55extern Int VG_(clo_gen_suppressions);
56/* Sanity-check level: 0 = none, 1 (default), > 1 = expensive. */
57extern Int VG_(clo_sanity_level);
58/* Automatically attempt to demangle C++ names? default: YES */
59extern Bool VG_(clo_demangle);
60/* Simulate child processes? default: NO */
61extern Bool VG_(clo_trace_children);
62
63/* Where logging output is to be sent to.
64
65 With --log-fd (and by default), clo_log_fd holds the file id, and is
66 taken from the command line. (fd 2, stderr, is the default.)
67 clo_log_name is irrelevant.
68
69 With --log-file/--log-file-exactly, clo_log_name holds the log-file
70 name, and is taken from the command line. clo_log_fd is then
71 made to hold the relevant file id, by opening clo_log_name
72 (concatenated with the process ID) for writing.
73
sewardjad311162005-07-19 11:25:02 +000074 With --log-file, there is an additional twist: if
75 clo_log_file_qualifier is non-NULL, the contents of the environment
76 variable specified by clo_log_file_qualifier is incorporated into
77 the logfile name. This is useful in that it allows the logfile
78 name to incorporate environmental information.
79
njn20242342005-05-16 23:31:24 +000080 With --log-socket, clo_log_name holds the hostname:portnumber pair,
81 and is taken from the command line. clo_log_fd is then made to hold
82 the relevant file handle, by opening a connection to that
83 hostname:portnumber pair.
84
85 Global default is to set log_to == VgLogTo_Fd and log_fd == 2
86 (stderr). */
sewardjad311162005-07-19 11:25:02 +000087extern Int VG_(clo_log_fd);
88extern Char* VG_(clo_log_name);
89extern Char* VG_(clo_log_file_qualifier);
njn20242342005-05-16 23:31:24 +000090
91/* Add timestamps to log messages? default: NO */
92extern Bool VG_(clo_time_stamp);
93
94/* The file descriptor to read for input. default: 0 == stdin */
95extern Int VG_(clo_input_fd);
96/* The number of suppression files specified. */
97extern Int VG_(clo_n_suppressions);
98/* The names of the suppression files. */
99extern Char* VG_(clo_suppressions)[VG_CLO_MAX_SFILES];
100
101/* DEBUG: print generated code? default: 00000000 ( == NO ) */
102extern Bool VG_(clo_trace_flags);
103/* DEBUG: do bb profiling? default: 00000000 ( == NO ) */
104extern Bool VG_(clo_profile_flags);
105/* DEBUG: if tracing codegen, be quiet until after this bb ( 0 ) */
106extern Int VG_(clo_trace_notbelow);
107/* DEBUG: print system calls? default: NO */
108extern Bool VG_(clo_trace_syscalls);
109/* DEBUG: print signal details? default: NO */
110extern Bool VG_(clo_trace_signals);
111/* DEBUG: print symtab details? default: NO */
112extern Bool VG_(clo_trace_symtab);
113/* DEBUG: print call-frame-info details? default: NO */
114extern Bool VG_(clo_trace_cfi);
115/* DEBUG: print redirection details? default: NO */
116extern Bool VG_(clo_trace_redir);
117/* DEBUG: print thread scheduling events? default: NO */
118extern Bool VG_(clo_trace_sched);
119/* DEBUG: print pthreads calls? default: NO */
120extern Bool VG_(clo_trace_pthreads);
121/* Display gory details for the k'th most popular error. default:
122 Infinity. */
123extern Int VG_(clo_dump_error);
124/* Number of parents of a backtrace. Default: 8. */
125extern Int VG_(clo_backtrace_size);
126/* Engage miscellaneous weird hacks needed for some progs. */
127extern Char* VG_(clo_weird_hacks);
128
129/* Track open file descriptors? */
130extern Bool VG_(clo_track_fds);
131
132/* Should we run __libc_freeres at exit? Sometimes causes crashes.
133 Default: YES. Note this is subservient to VG_(needs).libc_freeres;
134 if the latter says False, then the setting of VG_(clo_weird_hacks)
135 is ignored. Ie if a tool says no, I don't want this to run, that
136 cannot be overridden from the command line. */
137extern Bool VG_(clo_run_libc_freeres);
138/* Generate branch-prediction hints? */
139extern Bool VG_(clo_branchpred);
140/* Continue stack traces below main()? Default: NO */
141extern Bool VG_(clo_show_below_main);
142/* Test each client pointer dereference to check it's within the
143 client address space bounds */
144extern Bool VG_(clo_pointercheck);
145/* Model the pthread library */
146extern Bool VG_(clo_model_pthreads);
147
148/* HACK: Use hacked version of clone for Quadrics Elan3 drivers */
149extern Bool VG_(clo_support_elan3);
150
151/* Should we show VEX emulation warnings? Default: NO */
152extern Bool VG_(clo_show_emwarns);
153
154/* How much does the stack pointer have to change before tools
155 consider a stack switch to have happened? Default: 2000000 bytes */
156extern Int VG_(clo_max_stackframe);
157
158/* Delay startup to allow GDB to be attached? Default: NO */
159extern Bool VG_(clo_wait_for_gdb);
160
sewardj26412bd2005-07-07 10:05:05 +0000161/* To what extent should self-checking translations be made? These
162 are needed to deal with self-modifying code on uncooperative
163 platforms. */
164typedef
165 enum {
166 Vg_SmcNone, // never generate self-checking translations
167 Vg_SmcStack, // generate s-c-t's for code found in stacks
168 // (segments with SF_GROWDOWN, to be precise)
169 // (this is the default)
170 Vg_SmcAll // make all translations self-checking.
171 }
172 VgSmc;
173
174extern VgSmc VG_(clo_smc_support);
175
176
njn20242342005-05-16 23:31:24 +0000177#endif // __PUB_CORE_OPTIONS_H
178
179/*--------------------------------------------------------------------*/
180/*--- end ---*/
181/*--------------------------------------------------------------------*/