]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Track Vex controllability changes.
authorJulian Seward <jseward@acm.org>
Mon, 25 Oct 2004 13:04:59 +0000 (13:04 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 25 Oct 2004 13:04:59 +0000 (13:04 +0000)
git-svn-id: svn://svn.valgrind.org/vex/trunk@421

VEX/head20041019/coregrind/core.h
VEX/head20041019/coregrind/vg_main.c
VEX/head20041019/coregrind/vg_translate.c

index 66fda91ddef07f9d7a24bd81fa334f10db7a218a..667a53ae2994756ace3bf2fef9f6baa55f6bd203 100644 (file)
@@ -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 */
index a09407961fca43ec64c02600778126e00a8c76e0..dfa9ad9d5f33cbfb6f29c9149be36c43cdcb2d92 100644 (file)
@@ -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=<number>     show translation for basic block associated\n"
 "                              with <number>'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;
index 59b71599a3472d189d33b667917549811527f17a..c8b6db9c097e6559592357f8cc944536b1655250 100644 (file)
@@ -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;
    }