]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
debug options: add more description for sanity-level
authorPaul Floyd <pjfloyd@wanadoo.fr>
Sat, 17 Feb 2024 07:23:57 +0000 (08:23 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Sat, 17 Feb 2024 07:23:57 +0000 (08:23 +0100)
And make usage more consistent. There was a mix of > and >=, now
it is all >=.

coregrind/m_aspacemgr/aspacemgr-linux.c
coregrind/m_main.c
coregrind/m_scheduler/scheduler.c
coregrind/m_signals.c
none/tests/cmdline2.stdout.exp
none/tests/cmdline2.stdout.exp-non-linux

index d9d1512b5a6df61cfe312e90498c050906f52e3f..22eefd30d4a9353712be7c01eda16393ecc858e5 100644 (file)
@@ -332,7 +332,6 @@ static Addr aspacem_cStart = 0;
 // Where aspacem will start looking for Valgrind space
 static Addr aspacem_vStart = 0;
 
-
 #define AM_SANITY_CHECK                                      \
    do {                                                      \
       if (VG_(clo_sanity_level) >= 3)                        \
index 3015a533c9639da255233fe143ff72ba2e0b7a14..042b2787c7d422a7997d02105ee028f28574f473 100644 (file)
@@ -255,6 +255,10 @@ static void usage_NORETURN ( int need_help )
 "    -d                        show verbose debugging output\n"
 "    --stats=no|yes            show tool and core statistics [no]\n"
 "    --sanity-level=<number>   level of sanity checking to do [1]\n"
+"                              1 - does occasional stack checking\n"
+"                              2 - more stack checks and malloc checks\n"
+"                              3 - as 2 and mmap checks\n"
+"                              4 - as 3 and translation sector checks\n"
 "    --trace-flags=<XXXXXXXX>   show generated code? (X = 0|1) [00000000]\n"
 "    --profile-flags=<XXXXXXXX> ditto, but for profiling (X = 0|1) [00000000]\n"
 "    --profile-interval=<number> show profile every <number> event checks\n"
index f8b3b46c1ee4249485c23a5e6d9d9bc5529c4a06..6456eb1ac65ea7a7bda97d90f3f1cbe71322193a 100644 (file)
@@ -1550,7 +1550,7 @@ VgSchedReturnCode VG_(scheduler) ( ThreadId tid )
       /* amd64-linux, ppc32-linux, amd64-darwin, amd64-solaris */
       case VEX_TRC_JMP_SYS_SYSCALL:
         handle_syscall(tid, trc[0]);
-        if (VG_(clo_sanity_level) > 2)
+         if (VG_(clo_sanity_level) >= 3)
            VG_(sanity_check_general)(True); /* sanity-check every syscall */
         break;
 
@@ -2370,7 +2370,7 @@ void VG_(sanity_check_general) ( Bool force_expensive )
       Gradually increase the interval between such checks so as not to
       burden long-running programs too much. */
    if ( force_expensive
-        || VG_(clo_sanity_level) > 1
+        || VG_(clo_sanity_level) >= 2
         || (VG_(clo_sanity_level) == 1 
             && sanity_fast_count == next_slow_check_at)) {
 
@@ -2410,7 +2410,7 @@ void VG_(sanity_check_general) ( Bool force_expensive )
       }
    }
 
-   if (VG_(clo_sanity_level) > 1) {
+   if (VG_(clo_sanity_level) >= 2) {
       /* Check sanity of the low-level memory manager.  Note that bugs
          in the client's code can cause this to fail, so we don't do
          this check unless specially asked for.  And because it's
index b3c94fcc90d825c1950e0aa04404104c92d2450d..5977e38579fcd68f7c8e19586869f7b9deb7f618 100644 (file)
@@ -2698,7 +2698,7 @@ Bool VG_(extend_stack)(ThreadId tid, Addr addr)
       code know about it. */
    VG_(change_stack)(VG_(clstk_id), new_stack_base, VG_(clstk_end));
 
-   if (VG_(clo_sanity_level) > 2)
+   if (VG_(clo_sanity_level) >= 3)
       VG_(sanity_check_general)(False);
 
    return True;
index 28323ab061954fffc3de44ed25ed907248008fe8..e46504338c613c1fdad6a6f7953dee5071ebd76c 100644 (file)
@@ -166,6 +166,10 @@ usage: valgrind [options] prog-and-args
     -d                        show verbose debugging output
     --stats=no|yes            show tool and core statistics [no]
     --sanity-level=<number>   level of sanity checking to do [1]
+                              1 - does occasional stack checking
+                              2 - more stack checks and malloc checks
+                              3 - as 2 and mmap checks
+                              4 - as 3 and translation sector checks
     --trace-flags=<XXXXXXXX>   show generated code? (X = 0|1) [00000000]
     --profile-flags=<XXXXXXXX> ditto, but for profiling (X = 0|1) [00000000]
     --profile-interval=<number> show profile every <number> event checks
index 0b6ad0cfa97591bd92d6ecfc7227b5e88dce5a01..c4c8bde5a6d9a03642f3f1a5c7cdc651f432c560 100644 (file)
@@ -164,6 +164,10 @@ usage: valgrind [options] prog-and-args
     -d                        show verbose debugging output
     --stats=no|yes            show tool and core statistics [no]
     --sanity-level=<number>   level of sanity checking to do [1]
+                              1 - does occasional stack checking
+                              2 - more stack checks and malloc checks
+                              3 - as 2 and mmap checks
+                              4 - as 3 and translation sector checks
     --trace-flags=<XXXXXXXX>   show generated code? (X = 0|1) [00000000]
     --profile-flags=<XXXXXXXX> ditto, but for profiling (X = 0|1) [00000000]
     --profile-interval=<number> show profile every <number> event checks