Improve verbosity control, so that verbosity can be set individually
for each bb translated.  Exploit this in vg_translate.c.


git-svn-id: svn://svn.valgrind.org/vex/trunk@145 8f6e269a-dfd6-0310-a8e1-e2731360e62c
diff --git a/priv/main/vex_main.c b/priv/main/vex_main.c
index 657feb9..752f20f 100644
--- a/priv/main/vex_main.c
+++ b/priv/main/vex_main.c
@@ -29,7 +29,7 @@
    void (*log_bytes) ( Char*, Int nbytes ),
    /* debug paranoia level */
    Int debuglevel,
-   /* verbosity level */
+   /* initial verbosity level */
    Int verbosity,
    /* Are we supporting valgrind checking? */
    Bool valgrind_support,
@@ -76,7 +76,9 @@
    /* IN: optionally, an instrumentation function. */
    IRBB* (*instrument) ( IRBB* ),
    /* IN: optionally, an access check function for guest code. */
-   Bool (*byte_accessible) ( Addr64 )
+   Bool (*byte_accessible) ( Addr64 ),
+   /* IN: if > 0, use this verbosity for this bb */
+   Int  bb_verbosity
 )
 {
    /* This the bundle of functions we need to do the back-end stuff
@@ -101,7 +103,7 @@
    IRBB*        irbb;
    HInstrArray* vcode;
    HInstrArray* rcode;
-   Int          i, j, k, out_used;
+   Int          i, j, k, out_used, saved_verbosity;
    UChar        insn_bytes[32];
 
    available_real_regs    = NULL;
@@ -118,6 +120,10 @@
    emit                   = NULL;
    findHelper             = NULL;
 
+   saved_verbosity = vex_verbosity;
+   if (bb_verbosity > 0)
+      vex_verbosity = bb_verbosity;
+
    vassert(vex_initdone);
    LibVEX_ClearTemporary(False);
 
@@ -160,6 +166,7 @@
    if (irbb == NULL) {
       /* Access failure. */
       LibVEX_ClearTemporary(False);
+      vex_verbosity = saved_verbosity;
       return TransAccessFail;
    }
    sanityCheckIRBB(irbb, Ity_I32);
@@ -216,6 +223,7 @@
       }
       if (out_used + j > host_bytes_size) {
          LibVEX_ClearTemporary(False);
+         vex_verbosity = saved_verbosity;
          return TransOutputFull;
       }
       for (k = 0; k < j; k++) {
@@ -229,6 +237,7 @@
    //   LibVEX_ClearTemporary(True);
    LibVEX_ClearTemporary(False);
 
+   vex_verbosity = saved_verbosity;
    return TransOK;
 }