]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add command line flag --trace-notabove which I've found handy.
authorFlorian Krohm <florian@eich-krohm.de>
Mon, 2 Jul 2012 21:13:34 +0000 (21:13 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Mon, 2 Jul 2012 21:13:34 +0000 (21:13 +0000)
There are 4 cases now:
(1) Neither --trace-notbelow nor --trace-notabove are given
    No superblocks are traced (same behaviour as before)
(2) --trace-notbelow=YY is given
    Superblocks in interval [YY ... ] are traced. (same behaviour as before)
(3) --trace-notabove=XX is given
    Superblocks in interval [0 ... XX] are traced.
(4) Both --trace-notbelow=YY and --trace-notabove=XX are given
    Superblocks in the interval [XX..YY] are traced

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12701

coregrind/m_main.c
coregrind/m_options.c
coregrind/m_translate.c
coregrind/pub_core_options.h

index d02e5a4b360c10c4c6eb91e0b612a9352586c61f..33df5f30bb3a1c4a40a1e3dce31c0f84556328c1 100644 (file)
@@ -205,6 +205,7 @@ static void usage_NORETURN ( Bool debug_help )
 "    --trace-flags=<XXXXXXXX>   show generated code? (X = 0|1) [00000000]\n"
 "    --profile-flags=<XXXXXXXX> ditto, but for profiling (X = 0|1) [00000000]\n"
 "    --trace-notbelow=<number> only show BBs above <number> [999999999]\n"
+"    --trace-notabove=<number> only show BBs below <number> [0]\n"
 "    --trace-syscalls=no|yes   show all system calls? [no]\n"
 "    --trace-signals=no|yes    show signal handling details? [no]\n"
 "    --trace-symtab=no|yes     show symbol table details? [no]\n"
@@ -237,7 +238,7 @@ static void usage_NORETURN ( Bool debug_help )
 "       0000 0100   show selecting insns\n"
 "       0000 0010   show after reg-alloc\n"
 "       0000 0001   show final assembly\n"
-"      (Nb: you need --trace-notbelow with --trace-flags for full details)\n"
+"      (Nb: you need --trace-notbelow and/or --trace-notabove with --trace-flags for full details)\n"
 "\n"
 "  debugging options for Valgrind tools that report errors\n"
 "    --dump-error=<number>     show translation for basic block associated\n"
@@ -686,6 +687,8 @@ void main_process_cmd_line_options ( /*OUT*/Bool* logging_to_fd,
 
       else if VG_INT_CLO (arg, "--trace-notbelow", VG_(clo_trace_notbelow)) {}
 
+      else if VG_INT_CLO (arg, "--trace-notabove", VG_(clo_trace_notabove)) {}
+
       else if VG_XACT_CLO(arg, "--gen-suppressions=no",
                                VG_(clo_gen_suppressions), 0) {}
       else if VG_XACT_CLO(arg, "--gen-suppressions=yes",
@@ -720,6 +723,24 @@ void main_process_cmd_line_options ( /*OUT*/Bool* logging_to_fd,
    if (VG_(clo_verbosity) < 0)
       VG_(clo_verbosity) = 0;
 
+   if (VG_(clo_trace_notbelow) == -1) {
+     if (VG_(clo_trace_notabove) == -1) {
+       /* [] */
+       VG_(clo_trace_notbelow) = 2147483647;
+       VG_(clo_trace_notabove) = 0;
+     } else {
+       /* [0 .. notabove] */
+       VG_(clo_trace_notbelow) = 0;
+     }
+   } else {
+     if (VG_(clo_trace_notabove) == -1) {
+       /* [notbelow .. ]  */
+       VG_(clo_trace_notabove) = 2147483647;
+     } else {
+       /* [notbelow .. notabove]  */
+     }
+   }
+
    VG_(dyn_vgdb_error) = VG_(clo_vgdb_error);
 
    if (VG_(clo_gen_suppressions) > 0 && 
index ca186c01d47337a309d3cef930178526efb69fd2..ab38d080e8f0b465b537eab23b896016725706c5 100644 (file)
@@ -81,7 +81,8 @@ Int    VG_(clo_n_fullpath_after) = 0;
 Char*  VG_(clo_fullpath_after)[VG_CLO_MAX_FULLPATH_AFTER];
 UChar  VG_(clo_trace_flags)    = 0; // 00000000b
 UChar  VG_(clo_profile_flags)  = 0; // 00000000b
-Int    VG_(clo_trace_notbelow) = 999999999;
+Int    VG_(clo_trace_notbelow) = -1;  // unspecified
+Int    VG_(clo_trace_notabove) = -1;  // unspecified
 Bool   VG_(clo_trace_syscalls) = False;
 Bool   VG_(clo_trace_signals)  = False;
 Bool   VG_(clo_trace_symtab)   = False;
index fc6fa6287cca3355af6c778b3af7c8ebb94786f2..2c2f41f865c37c778cbab254f45d8e231cfd7154 100644 (file)
@@ -1420,6 +1420,7 @@ Bool VG_(translate) ( ThreadId tid,
    }
    else
    if ( (VG_(clo_trace_flags) > 0
+        && VG_(get_bbs_translated)() <= VG_(clo_trace_notabove)
         && VG_(get_bbs_translated)() >= VG_(clo_trace_notbelow) )) {
       verbosity = VG_(clo_trace_flags);
    }
index 5e81b768d7848ddbb21e2387c87526fff7c69d36..60978e1241a90d70f4af335e4ced4a0928413367 100644 (file)
@@ -130,8 +130,10 @@ extern Char* VG_(clo_fullpath_after)[VG_CLO_MAX_FULLPATH_AFTER];
 extern UChar VG_(clo_trace_flags);
 /* DEBUG: do bb profiling?  default: 00000000 ( == NO ) */
 extern UChar VG_(clo_profile_flags);
-/* DEBUG: if tracing codegen, be quiet until after this bb ( 0 ) */
+/* DEBUG: if tracing codegen, be quiet until after this bb */
 extern Int   VG_(clo_trace_notbelow);
+/* DEBUG: if tracing codegen, be quiet after this bb  */
+extern Int   VG_(clo_trace_notabove);
 /* DEBUG: print system calls?  default: NO */
 extern Bool  VG_(clo_trace_syscalls);
 /* DEBUG: print signal details?  default: NO */