sewardj | 3282402 | 2005-05-17 13:45:04 +0000 | [diff] [blame] | 1 | |
| 2 | /*--------------------------------------------------------------------*/ |
njn | b1cc5d6 | 2010-07-06 04:05:23 +0000 | [diff] [blame] | 3 | /*--- Command line options. m_options.c ---*/ |
sewardj | 3282402 | 2005-05-17 13:45:04 +0000 | [diff] [blame] | 4 | /*--------------------------------------------------------------------*/ |
| 5 | |
| 6 | /* |
| 7 | This file is part of Valgrind, a dynamic binary instrumentation |
| 8 | framework. |
| 9 | |
sewardj | 9eecbbb | 2010-05-03 21:37:12 +0000 | [diff] [blame] | 10 | Copyright (C) 2000-2010 Nicholas Nethercote |
sewardj | 3282402 | 2005-05-17 13:45:04 +0000 | [diff] [blame] | 11 | njn@valgrind.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 | |
njn | c7561b9 | 2005-06-19 01:24:32 +0000 | [diff] [blame] | 31 | #include "pub_core_basics.h" |
njn | 374a36d | 2007-11-23 01:41:32 +0000 | [diff] [blame] | 32 | #include "pub_core_vki.h" |
njn | a3506d3 | 2005-05-18 04:36:01 +0000 | [diff] [blame] | 33 | #include "pub_core_options.h" |
sewardj | 6893d65 | 2006-10-15 01:25:13 +0000 | [diff] [blame] | 34 | #include "pub_core_libcassert.h" |
njn | 374a36d | 2007-11-23 01:41:32 +0000 | [diff] [blame] | 35 | #include "pub_core_libcbase.h" |
| 36 | #include "pub_core_libcfile.h" |
sewardj | 6893d65 | 2006-10-15 01:25:13 +0000 | [diff] [blame] | 37 | #include "pub_core_libcprint.h" |
njn | 374a36d | 2007-11-23 01:41:32 +0000 | [diff] [blame] | 38 | #include "pub_core_libcproc.h" |
| 39 | #include "pub_core_mallocfree.h" |
sewardj | 0642127 | 2009-11-05 08:55:13 +0000 | [diff] [blame] | 40 | #include "pub_core_seqmatch.h" // VG_(string_match) |
sewardj | 3282402 | 2005-05-17 13:45:04 +0000 | [diff] [blame] | 41 | |
njn | a3506d3 | 2005-05-18 04:36:01 +0000 | [diff] [blame] | 42 | // See pub_{core,tool}_options.h for explanations of all these. |
| 43 | |
| 44 | |
| 45 | /* Define, and set defaults. */ |
| 46 | VexControl VG_(clo_vex_control); |
| 47 | Bool VG_(clo_error_limit) = True; |
sewardj | b977908 | 2006-05-12 23:50:15 +0000 | [diff] [blame] | 48 | Int VG_(clo_error_exitcode) = 0; |
sewardj | 3b29048 | 2011-05-06 21:02:55 +0000 | [diff] [blame] | 49 | VgVgdb VG_(clo_vgdb) = Vg_VgdbYes; |
| 50 | Int VG_(clo_vgdb_poll) = 5000; |
| 51 | Int VG_(clo_vgdb_error) = 999999999; |
| 52 | Char* VG_(clo_vgdb_prefix) = VG_CLO_VGDB_PREFIX_DEFAULT; |
| 53 | Bool VG_(clo_vgdb_shadow_registers) = False; |
njn | a3506d3 | 2005-05-18 04:36:01 +0000 | [diff] [blame] | 54 | Bool VG_(clo_db_attach) = False; |
| 55 | Char* VG_(clo_db_command) = GDB_PATH " -nw %f %p"; |
| 56 | Int VG_(clo_gen_suppressions) = 0; |
| 57 | Int VG_(clo_sanity_level) = 1; |
| 58 | Int VG_(clo_verbosity) = 1; |
sewardj | 2d9e874 | 2009-08-07 15:46:56 +0000 | [diff] [blame] | 59 | Bool VG_(clo_stats) = False; |
sewardj | 71bc3cb | 2005-05-19 00:25:45 +0000 | [diff] [blame] | 60 | Bool VG_(clo_xml) = False; |
sewardj | 768db0e | 2005-07-19 14:18:56 +0000 | [diff] [blame] | 61 | HChar* VG_(clo_xml_user_comment) = NULL; |
njn | a3506d3 | 2005-05-18 04:36:01 +0000 | [diff] [blame] | 62 | Bool VG_(clo_demangle) = True; |
| 63 | Bool VG_(clo_trace_children) = False; |
sewardj | 0642127 | 2009-11-05 08:55:13 +0000 | [diff] [blame] | 64 | HChar* VG_(clo_trace_children_skip) = NULL; |
sewardj | 9ab64a4 | 2010-12-06 11:40:04 +0000 | [diff] [blame] | 65 | HChar* VG_(clo_trace_children_skip_by_arg) = NULL; |
sewardj | 6e31f80 | 2007-11-17 22:29:25 +0000 | [diff] [blame] | 66 | Bool VG_(clo_child_silent_after_fork) = False; |
sewardj | 738856f | 2009-07-15 14:48:32 +0000 | [diff] [blame] | 67 | Char* VG_(clo_log_fname_expanded) = NULL; |
| 68 | Char* VG_(clo_xml_fname_expanded) = NULL; |
njn | a3506d3 | 2005-05-18 04:36:01 +0000 | [diff] [blame] | 69 | Bool VG_(clo_time_stamp) = False; |
| 70 | Int VG_(clo_input_fd) = 0; /* stdin */ |
| 71 | Int VG_(clo_n_suppressions) = 0; |
| 72 | Char* VG_(clo_suppressions)[VG_CLO_MAX_SFILES]; |
sewardj | 14cdbf8 | 2010-10-12 00:44:05 +0000 | [diff] [blame] | 73 | Int VG_(clo_n_fullpath_after) = 0; |
| 74 | Char* VG_(clo_fullpath_after)[VG_CLO_MAX_FULLPATH_AFTER]; |
njn | a3506d3 | 2005-05-18 04:36:01 +0000 | [diff] [blame] | 75 | UChar VG_(clo_trace_flags) = 0; // 00000000b |
| 76 | UChar VG_(clo_profile_flags) = 0; // 00000000b |
sewardj | 33afdb5 | 2006-01-17 02:36:40 +0000 | [diff] [blame] | 77 | Int VG_(clo_trace_notbelow) = 999999999; |
njn | a3506d3 | 2005-05-18 04:36:01 +0000 | [diff] [blame] | 78 | Bool VG_(clo_trace_syscalls) = False; |
| 79 | Bool VG_(clo_trace_signals) = False; |
| 80 | Bool VG_(clo_trace_symtab) = False; |
sewardj | f767d96 | 2007-02-12 17:47:14 +0000 | [diff] [blame] | 81 | HChar* VG_(clo_trace_symtab_patt) = "*"; |
njn | a3506d3 | 2005-05-18 04:36:01 +0000 | [diff] [blame] | 82 | Bool VG_(clo_trace_cfi) = False; |
sewardj | f767d96 | 2007-02-12 17:47:14 +0000 | [diff] [blame] | 83 | Bool VG_(clo_debug_dump_syms) = False; |
| 84 | Bool VG_(clo_debug_dump_line) = False; |
| 85 | Bool VG_(clo_debug_dump_frames) = False; |
njn | a3506d3 | 2005-05-18 04:36:01 +0000 | [diff] [blame] | 86 | Bool VG_(clo_trace_redir) = False; |
| 87 | Bool VG_(clo_trace_sched) = False; |
sewardj | 9c606bd | 2008-09-18 18:12:50 +0000 | [diff] [blame] | 88 | Bool VG_(clo_profile_heap) = False; |
njn | a3506d3 | 2005-05-18 04:36:01 +0000 | [diff] [blame] | 89 | Int VG_(clo_dump_error) = 0; |
| 90 | Int VG_(clo_backtrace_size) = 12; |
njn | 628add6 | 2005-11-12 18:21:40 +0000 | [diff] [blame] | 91 | Char* VG_(clo_sim_hints) = NULL; |
sewardj | 41ded2c | 2006-10-17 01:34:57 +0000 | [diff] [blame] | 92 | Bool VG_(clo_sym_offsets) = False; |
sewardj | b8b79ad | 2008-03-03 01:35:41 +0000 | [diff] [blame] | 93 | Bool VG_(clo_read_var_info) = False; |
sewardj | f9ebc39 | 2010-05-09 22:30:43 +0000 | [diff] [blame] | 94 | Int VG_(clo_n_req_tsyms) = 0; |
| 95 | HChar* VG_(clo_req_tsyms)[VG_CLO_MAX_REQ_TSYMS]; |
| 96 | HChar* VG_(clo_require_text_symbol) = NULL; |
njn | a3506d3 | 2005-05-18 04:36:01 +0000 | [diff] [blame] | 97 | Bool VG_(clo_run_libc_freeres) = True; |
| 98 | Bool VG_(clo_track_fds) = False; |
| 99 | Bool VG_(clo_show_below_main)= False; |
njn | a3506d3 | 2005-05-18 04:36:01 +0000 | [diff] [blame] | 100 | Bool VG_(clo_show_emwarns) = False; |
sewardj | 91b470c | 2007-08-28 17:03:01 +0000 | [diff] [blame] | 101 | Word VG_(clo_max_stackframe) = 2000000; |
sewardj | 95d86c0 | 2007-12-18 01:49:23 +0000 | [diff] [blame] | 102 | Word VG_(clo_main_stacksize) = 0; /* use client's rlimit.stack */ |
njn | a3506d3 | 2005-05-18 04:36:01 +0000 | [diff] [blame] | 103 | Bool VG_(clo_wait_for_gdb) = False; |
sewardj | 6c3a219 | 2005-07-24 07:00:45 +0000 | [diff] [blame] | 104 | VgSmc VG_(clo_smc_check) = Vg_SmcStack; |
sewardj | ce5a566 | 2005-10-06 03:19:49 +0000 | [diff] [blame] | 105 | HChar* VG_(clo_kernel_variant) = NULL; |
njn | 97db761 | 2009-08-04 02:32:55 +0000 | [diff] [blame] | 106 | Bool VG_(clo_dsymutil) = False; |
sewardj | 26412bd | 2005-07-07 10:05:05 +0000 | [diff] [blame] | 107 | |
sewardj | 3282402 | 2005-05-17 13:45:04 +0000 | [diff] [blame] | 108 | |
sewardj | 6893d65 | 2006-10-15 01:25:13 +0000 | [diff] [blame] | 109 | /*====================================================================*/ |
njn | b1cc5d6 | 2010-07-06 04:05:23 +0000 | [diff] [blame] | 110 | /*=== File expansion ===*/ |
sewardj | 6893d65 | 2006-10-15 01:25:13 +0000 | [diff] [blame] | 111 | /*====================================================================*/ |
| 112 | |
njn | 374a36d | 2007-11-23 01:41:32 +0000 | [diff] [blame] | 113 | // Copies the string, prepending it with the startup working directory, and |
| 114 | // expanding %p and %q entries. Returns a new, malloc'd string. |
| 115 | Char* VG_(expand_file_name)(Char* option_name, Char* format) |
| 116 | { |
| 117 | static Char base_dir[VKI_PATH_MAX]; |
| 118 | Int len, i = 0, j = 0; |
| 119 | Char* out; |
| 120 | |
| 121 | Bool ok = VG_(get_startup_wd)(base_dir, VKI_PATH_MAX); |
| 122 | tl_assert(ok); |
| 123 | |
| 124 | if (VG_STREQ(format, "")) { |
| 125 | // Empty name, bad. |
njn | b1cc5d6 | 2010-07-06 04:05:23 +0000 | [diff] [blame] | 126 | VG_(fmsg)("%s: filename is empty", option_name); |
njn | 5542d8f | 2009-06-09 00:50:45 +0000 | [diff] [blame] | 127 | goto bad; |
| 128 | } |
| 129 | |
| 130 | // If 'format' starts with a '~', abort -- the user probably expected the |
| 131 | // shell to expand but it didn't (see bug 195268 for details). This means |
| 132 | // that we don't allow a legitimate filename beginning with '~' but that |
| 133 | // seems very unlikely. |
| 134 | if (format[0] == '~') { |
njn | b1cc5d6 | 2010-07-06 04:05:23 +0000 | [diff] [blame] | 135 | VG_(fmsg)( |
| 136 | "%s: filename begins with '~'\n" |
| 137 | "You probably expected the shell to expand the '~', but it\n" |
| 138 | "didn't. The rules for '~'-expansion vary from shell to shell.\n" |
| 139 | "You might have more luck using $HOME instead.\n", |
| 140 | option_name |
| 141 | ); |
njn | 374a36d | 2007-11-23 01:41:32 +0000 | [diff] [blame] | 142 | goto bad; |
| 143 | } |
| 144 | |
njn | 2dd08f5 | 2007-11-23 22:37:35 +0000 | [diff] [blame] | 145 | // If 'format' starts with a '/', do not prefix with startup dir. |
| 146 | if (format[0] != '/') { |
| 147 | j += VG_(strlen)(base_dir); |
| 148 | } |
| 149 | |
njn | 374a36d | 2007-11-23 01:41:32 +0000 | [diff] [blame] | 150 | // The 10 is slop, it should be enough in most cases. |
njn | 374a36d | 2007-11-23 01:41:32 +0000 | [diff] [blame] | 151 | len = j + VG_(strlen)(format) + 10; |
sewardj | 9c606bd | 2008-09-18 18:12:50 +0000 | [diff] [blame] | 152 | out = VG_(malloc)( "options.efn.1", len ); |
njn | 2dd08f5 | 2007-11-23 22:37:35 +0000 | [diff] [blame] | 153 | if (format[0] != '/') { |
| 154 | VG_(strcpy)(out, base_dir); |
| 155 | out[j++] = '/'; |
| 156 | } |
njn | 374a36d | 2007-11-23 01:41:32 +0000 | [diff] [blame] | 157 | |
| 158 | #define ENSURE_THIS_MUCH_SPACE(x) \ |
| 159 | if (j + x >= len) { \ |
| 160 | len += (10 + x); \ |
sewardj | 9c606bd | 2008-09-18 18:12:50 +0000 | [diff] [blame] | 161 | out = VG_(realloc)("options.efn.2(multiple)", out, len); \ |
njn | 374a36d | 2007-11-23 01:41:32 +0000 | [diff] [blame] | 162 | } |
| 163 | |
njn | 374a36d | 2007-11-23 01:41:32 +0000 | [diff] [blame] | 164 | while (format[i]) { |
| 165 | if (format[i] != '%') { |
| 166 | ENSURE_THIS_MUCH_SPACE(1); |
| 167 | out[j++] = format[i++]; |
| 168 | |
| 169 | } else { |
| 170 | // We saw a '%'. What's next... |
| 171 | i++; |
| 172 | if ('%' == format[i]) { |
| 173 | // Replace '%%' with '%'. |
| 174 | ENSURE_THIS_MUCH_SPACE(1); |
| 175 | out[j++] = format[i++]; |
| 176 | } |
| 177 | else if ('p' == format[i]) { |
| 178 | // Print the PID. Assume that it's not longer than 10 chars -- |
| 179 | // reasonable since 'pid' is an Int (ie. 32 bits). |
| 180 | Int pid = VG_(getpid)(); |
| 181 | ENSURE_THIS_MUCH_SPACE(10); |
| 182 | j += VG_(sprintf)(&out[j], "%d", pid); |
| 183 | i++; |
| 184 | } |
njn | 2dd08f5 | 2007-11-23 22:37:35 +0000 | [diff] [blame] | 185 | else if ('q' == format[i]) { |
| 186 | i++; |
| 187 | if ('{' == format[i]) { |
| 188 | // Get the env var name, print its contents. |
| 189 | Char* qualname; |
| 190 | Char* qual; |
njn | 374a36d | 2007-11-23 01:41:32 +0000 | [diff] [blame] | 191 | i++; |
njn | 2dd08f5 | 2007-11-23 22:37:35 +0000 | [diff] [blame] | 192 | qualname = &format[i]; |
| 193 | while (True) { |
| 194 | if (0 == format[i]) { |
njn | b1cc5d6 | 2010-07-06 04:05:23 +0000 | [diff] [blame] | 195 | VG_(fmsg)("%s: malformed %%q specifier\n", option_name); |
njn | 2dd08f5 | 2007-11-23 22:37:35 +0000 | [diff] [blame] | 196 | goto bad; |
| 197 | } else if ('}' == format[i]) { |
| 198 | // Temporarily replace the '}' with NUL to extract var |
| 199 | // name. |
| 200 | format[i] = 0; |
| 201 | qual = VG_(getenv)(qualname); |
| 202 | if (NULL == qual) { |
njn | b1cc5d6 | 2010-07-06 04:05:23 +0000 | [diff] [blame] | 203 | VG_(fmsg)("%s: environment variable %s is not set\n", |
| 204 | option_name, qualname); |
njn | 2dd08f5 | 2007-11-23 22:37:35 +0000 | [diff] [blame] | 205 | format[i] = '}'; // Put the '}' back. |
| 206 | goto bad; |
| 207 | } |
| 208 | format[i] = '}'; // Put the '}' back. |
| 209 | i++; |
| 210 | break; |
| 211 | } |
| 212 | i++; |
| 213 | } |
| 214 | ENSURE_THIS_MUCH_SPACE(VG_(strlen)(qual)); |
| 215 | j += VG_(sprintf)(&out[j], "%s", qual); |
| 216 | } else { |
njn | b1cc5d6 | 2010-07-06 04:05:23 +0000 | [diff] [blame] | 217 | VG_(fmsg)("%s: expected '{' after '%%q'\n", option_name); |
njn | 2dd08f5 | 2007-11-23 22:37:35 +0000 | [diff] [blame] | 218 | goto bad; |
njn | 374a36d | 2007-11-23 01:41:32 +0000 | [diff] [blame] | 219 | } |
njn | 374a36d | 2007-11-23 01:41:32 +0000 | [diff] [blame] | 220 | } |
| 221 | else { |
| 222 | // Something else, abort. |
njn | b1cc5d6 | 2010-07-06 04:05:23 +0000 | [diff] [blame] | 223 | VG_(fmsg)("%s: expected 'p' or 'q' or '%%' after '%%'\n", |
| 224 | option_name); |
njn | 374a36d | 2007-11-23 01:41:32 +0000 | [diff] [blame] | 225 | goto bad; |
| 226 | } |
| 227 | } |
| 228 | } |
| 229 | ENSURE_THIS_MUCH_SPACE(1); |
| 230 | out[j++] = 0; |
| 231 | |
| 232 | return out; |
| 233 | |
| 234 | bad: { |
| 235 | Char* opt = // 2: 1 for the '=', 1 for the NUL. |
sewardj | 9c606bd | 2008-09-18 18:12:50 +0000 | [diff] [blame] | 236 | VG_(malloc)( "options.efn.3", |
| 237 | VG_(strlen)(option_name) + VG_(strlen)(format) + 2 ); |
njn | 374a36d | 2007-11-23 01:41:32 +0000 | [diff] [blame] | 238 | VG_(strcpy)(opt, option_name); |
| 239 | VG_(strcat)(opt, "="); |
| 240 | VG_(strcat)(opt, format); |
njn | b1cc5d6 | 2010-07-06 04:05:23 +0000 | [diff] [blame] | 241 | VG_(fmsg_bad_option)(opt, ""); |
njn | 374a36d | 2007-11-23 01:41:32 +0000 | [diff] [blame] | 242 | } |
| 243 | } |
| 244 | |
sewardj | 0642127 | 2009-11-05 08:55:13 +0000 | [diff] [blame] | 245 | /*====================================================================*/ |
| 246 | /*=== --trace-children= support ===*/ |
| 247 | /*====================================================================*/ |
| 248 | |
| 249 | static HChar const* consume_commas ( HChar const* c ) { |
| 250 | while (*c && *c == ',') { |
| 251 | ++c; |
| 252 | } |
| 253 | return c; |
| 254 | } |
| 255 | |
| 256 | static HChar const* consume_field ( HChar const* c ) { |
| 257 | while (*c && *c != ',') { |
| 258 | ++c; |
| 259 | } |
| 260 | return c; |
| 261 | } |
| 262 | |
| 263 | /* Should we trace into this child executable (across execve etc) ? |
sewardj | 9ab64a4 | 2010-12-06 11:40:04 +0000 | [diff] [blame] | 264 | This involves considering --trace-children=, |
| 265 | --trace-children-skip=, --trace-children-skip-by-arg=, and the name |
| 266 | of the executable. 'child_argv' must not include the name of the |
| 267 | executable itself; iow child_argv[0] must be the first arg, if any, |
| 268 | for the child. */ |
| 269 | Bool VG_(should_we_trace_this_child) ( HChar* child_exe_name, |
| 270 | HChar** child_argv ) |
sewardj | 0642127 | 2009-11-05 08:55:13 +0000 | [diff] [blame] | 271 | { |
| 272 | // child_exe_name is pulled out of the guest's space. We |
| 273 | // should be at least marginally cautious with it, lest it |
| 274 | // explode or burst into flames unexpectedly. |
| 275 | if (child_exe_name == NULL || VG_(strlen)(child_exe_name) == 0) |
| 276 | return VG_(clo_trace_children); // we know narfink |
| 277 | |
sewardj | 0642127 | 2009-11-05 08:55:13 +0000 | [diff] [blame] | 278 | // If --trace-children=no, the answer is simply NO. |
| 279 | if (! VG_(clo_trace_children)) |
| 280 | return False; |
| 281 | |
sewardj | 9ab64a4 | 2010-12-06 11:40:04 +0000 | [diff] [blame] | 282 | // Otherwise, look for other reasons to say NO. First, |
| 283 | // see if the exe name matches any of the patterns specified |
| 284 | // by --trace-children-skip=. |
sewardj | 0642127 | 2009-11-05 08:55:13 +0000 | [diff] [blame] | 285 | if (VG_(clo_trace_children_skip)) { |
| 286 | HChar const* last = VG_(clo_trace_children_skip); |
| 287 | HChar const* name = (HChar const*)child_exe_name; |
| 288 | while (*last) { |
| 289 | Bool matches; |
| 290 | HChar* patt; |
| 291 | HChar const* first = consume_commas(last); |
| 292 | last = consume_field(first); |
| 293 | if (first == last) |
| 294 | break; |
| 295 | vg_assert(last > first); |
| 296 | /* copy the candidate string into a temporary malloc'd block |
| 297 | so we can use VG_(string_match) on it. */ |
| 298 | patt = VG_(calloc)("m_options.swttc.1", last - first + 1, 1); |
| 299 | VG_(memcpy)(patt, first, last - first); |
| 300 | vg_assert(patt[last-first] == 0); |
| 301 | matches = VG_(string_match)(patt, name); |
| 302 | VG_(free)(patt); |
| 303 | if (matches) |
| 304 | return False; |
| 305 | } |
| 306 | } |
sewardj | 9ab64a4 | 2010-12-06 11:40:04 +0000 | [diff] [blame] | 307 | |
| 308 | // Check if any of the args match any of the patterns specified |
| 309 | // by --trace-children-skip-by-arg=. |
| 310 | if (VG_(clo_trace_children_skip_by_arg) && child_argv != NULL) { |
| 311 | HChar const* last = VG_(clo_trace_children_skip_by_arg); |
| 312 | while (*last) { |
| 313 | Int i; |
| 314 | Bool matches; |
| 315 | HChar* patt; |
| 316 | HChar const* first = consume_commas(last); |
| 317 | last = consume_field(first); |
| 318 | if (first == last) |
| 319 | break; |
| 320 | vg_assert(last > first); |
| 321 | /* copy the candidate string into a temporary malloc'd block |
| 322 | so we can use VG_(string_match) on it. */ |
| 323 | patt = VG_(calloc)("m_options.swttc.1", last - first + 1, 1); |
| 324 | VG_(memcpy)(patt, first, last - first); |
| 325 | vg_assert(patt[last-first] == 0); |
| 326 | for (i = 0; child_argv[i]; i++) { |
| 327 | matches = VG_(string_match)(patt, child_argv[i]); |
| 328 | if (matches) { |
| 329 | VG_(free)(patt); |
| 330 | return False; |
| 331 | } |
| 332 | } |
| 333 | VG_(free)(patt); |
| 334 | } |
| 335 | } |
| 336 | |
sewardj | 0642127 | 2009-11-05 08:55:13 +0000 | [diff] [blame] | 337 | // --trace-children=yes, and this particular executable isn't |
| 338 | // excluded |
| 339 | return True; |
| 340 | } |
njn | 374a36d | 2007-11-23 01:41:32 +0000 | [diff] [blame] | 341 | |
sewardj | 6893d65 | 2006-10-15 01:25:13 +0000 | [diff] [blame] | 342 | |
sewardj | 3282402 | 2005-05-17 13:45:04 +0000 | [diff] [blame] | 343 | /*--------------------------------------------------------------------*/ |
njn | b1cc5d6 | 2010-07-06 04:05:23 +0000 | [diff] [blame] | 344 | /*--- end ---*/ |
sewardj | 3282402 | 2005-05-17 13:45:04 +0000 | [diff] [blame] | 345 | /*--------------------------------------------------------------------*/ |