From: Julian Seward Date: Mon, 25 Oct 2004 13:04:59 +0000 (+0000) Subject: Track Vex controllability changes. X-Git-Tag: svn/VALGRIND_3_0_1^2~913 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5db5c8a0070922398f8c33edac3c4c7d8aa40617;p=thirdparty%2Fvalgrind.git Track Vex controllability changes. git-svn-id: svn://svn.valgrind.org/vex/trunk@421 --- diff --git a/VEX/head20041019/coregrind/core.h b/VEX/head20041019/coregrind/core.h index 66fda91dde..667a53ae29 100644 --- a/VEX/head20041019/coregrind/core.h +++ b/VEX/head20041019/coregrind/core.h @@ -91,6 +91,8 @@ #include "valgrind.h" +#include "../../pub/libvex.h" + #undef SK_ #define SK_(x) vgSkinInternal_##x @@ -234,6 +236,8 @@ extern Int VG_(main_pgrp); extern Int VG_(fd_soft_limit); extern Int VG_(fd_hard_limit); +/* Vex iropt control */ +extern VexControl VG_(clo_vex_control); /* Should we stop collecting errors if too many appear? default: YES */ extern Bool VG_(clo_error_limit); /* Enquire about whether to attach to a debugger at errors? default: NO */ diff --git a/VEX/head20041019/coregrind/vg_main.c b/VEX/head20041019/coregrind/vg_main.c index a09407961f..dfa9ad9d5f 100644 --- a/VEX/head20041019/coregrind/vg_main.c +++ b/VEX/head20041019/coregrind/vg_main.c @@ -1469,6 +1469,7 @@ void as_closepadfile(int padfile) /*====================================================================*/ /* Define, and set defaults. */ +VexControl VG_(clo_vex_control); Bool VG_(clo_error_limit) = True; Bool VG_(clo_db_attach) = False; Char* VG_(clo_db_command) = VG_CLO_DEFAULT_DBCOMMAND; @@ -1577,6 +1578,12 @@ void usage ( Bool debug_help ) " --trace-pthread=none|some|all show pthread event details? [none]\n" " --wait-for-gdb=yes|no pause on startup to wait for gdb attach\n" "\n" +" --vex-iropt-level 0 .. 2 [2]\n" +" --vex-iropt-precise-memory-exns [no]\n" +" --vex-iropt-unroll-thresh 0 .. 400 [120]\n" +" --vex-guest-max-insns 1 .. 100 [50]\n" +" --vex-guest-chase-thresh 0 .. 99 [10]\n" +"\n" " debugging options for Valgrind tools that report errors\n" " --dump-error= show translation for basic block associated\n" " with 'th error context [0=show none]\n" @@ -1623,6 +1630,8 @@ static void pre_process_cmd_line_options { UInt i; + LibVEX_default_VexControl(& VG_(clo_vex_control)); + /* parse the options we have (only the options we care about now) */ for (i = 1; i < vg_argc; i++) { @@ -1763,6 +1772,19 @@ static void process_cmd_line_options( UInt* client_auxv, const char* toolname ) else VG_BNUM_CLO("--num-callers", VG_(clo_backtrace_size), 1, VG_DEEPEST_BACKTRACE) + else VG_BNUM_CLO("--vex-iropt-verbosity", + VG_(clo_vex_control).iropt_verbosity, 0, 10) + else VG_BNUM_CLO("--vex-iropt-level", + VG_(clo_vex_control).iropt_level, 0, 2) + else VG_BOOL_CLO("--vex-iropt-precise-memory-exns", + VG_(clo_vex_control).iropt_precise_memory_exns) + else VG_BNUM_CLO("--vex-iropt-unroll-thresh", + VG_(clo_vex_control).iropt_unroll_thresh, 0, 400) + else VG_BNUM_CLO("--vex-guest-max-insns", + VG_(clo_vex_control).guest_max_insns, 1, 100) + else VG_BNUM_CLO("--vex-guest-chase-thresh", + VG_(clo_vex_control).guest_chase_thresh, 0, 99) + // for backwards compatibility, replaced by --log-fd else if (VG_CLO_STREQN(13, arg, "--logfile-fd=")) { VG_(clo_log_to) = VgLogTo_Fd; diff --git a/VEX/head20041019/coregrind/vg_translate.c b/VEX/head20041019/coregrind/vg_translate.c index 59b71599a3..c8b6db9c09 100644 --- a/VEX/head20041019/coregrind/vg_translate.c +++ b/VEX/head20041019/coregrind/vg_translate.c @@ -1438,7 +1438,7 @@ Bool VG_(translate) ( ThreadId tid, Addr orig_addr, 1, /* debug_paranoia */ 0, /* verbosity */ False, /* valgrind support */ - 50 /* max insns per bb */ ); + &VG_(clo_vex_control) ); vex_init_done = True; }