]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Make the --max-stackframe machinery 64-bit clean.
authorJulian Seward <jseward@acm.org>
Tue, 28 Aug 2007 17:03:01 +0000 (17:03 +0000)
committerJulian Seward <jseward@acm.org>
Tue, 28 Aug 2007 17:03:01 +0000 (17:03 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6788

coregrind/m_main.c
coregrind/m_options.c
coregrind/m_stacks.c
coregrind/pub_core_options.h
include/pub_tool_options.h

index 319753d803d834342bb7f32f68a1f397f99651eb..6e69e88cf8f787dff09806f3d9762d603f7e1a1a 100644 (file)
@@ -364,7 +364,7 @@ static Bool process_cmd_line_options( UInt* client_auxv, const char* toolname )
       else VG_BOOL_CLO(arg, "--error-limit",      VG_(clo_error_limit))
       else VG_NUM_CLO (arg, "--error-exitcode",   VG_(clo_error_exitcode))
       else VG_BOOL_CLO(arg, "--show-emwarns",     VG_(clo_show_emwarns))
-      else VG_NUM_CLO (arg, "--max-stackframe",   VG_(clo_max_stackframe))
+      else VG_NUMW_CLO(arg, "--max-stackframe",   VG_(clo_max_stackframe))
       else VG_BOOL_CLO(arg, "--run-libc-freeres", VG_(clo_run_libc_freeres))
       else VG_BOOL_CLO(arg, "--show-below-main",  VG_(clo_show_below_main))
       else VG_BOOL_CLO(arg, "--time-stamp",       VG_(clo_time_stamp))
index 030f78c70d27a3b5ea43feb920556a8d4ae8abf2..f5ed2846b2cb3e0a3353f196837c30ef1e95e3a7 100644 (file)
@@ -79,7 +79,7 @@ Bool   VG_(clo_run_libc_freeres) = True;
 Bool   VG_(clo_track_fds)      = False;
 Bool   VG_(clo_show_below_main)= False;
 Bool   VG_(clo_show_emwarns)   = False;
-Int    VG_(clo_max_stackframe) = 2000000;
+Word   VG_(clo_max_stackframe) = 2000000;
 Bool   VG_(clo_wait_for_gdb)   = False;
 VgSmc  VG_(clo_smc_check)      = Vg_SmcStack;
 HChar* VG_(clo_kernel_variant) = NULL;
index cf78e4d466aa10646deea6cd15b8dd1d17ad55b6..8400a6c8d61ee3676ececad80f7fdca73aa69c2b 100644 (file)
@@ -233,7 +233,7 @@ void VG_(unknown_SP_update)( Addr old_SP, Addr new_SP )
             "Warning: client switching stacks?  "
             "SP change: %p --> %p", old_SP, new_SP);
          VG_(message)(Vg_UserMsg,
-            "         to suppress, use: --max-stackframe=%d or greater",
+            "         to suppress, use: --max-stackframe=%ld or greater",
             (delta < 0 ? -delta : delta));
          if (moans == 0)
             VG_(message)(Vg_UserMsg,
index 0d0cb5a86351912cfbf0df9a69f0b1d4b8150056..09b97fcd1f2dcbf5fbc436f914e49f0482267e9d 100644 (file)
@@ -154,8 +154,9 @@ extern Bool VG_(clo_show_below_main);
 extern Bool VG_(clo_show_emwarns);
 
 /* How much does the stack pointer have to change before tools
-   consider a stack switch to have happened?  Default: 2000000 bytes */
-extern Int VG_(clo_max_stackframe);
+   consider a stack switch to have happened?  Default: 2000000 bytes
+   NB: must be host-word-sized to be correct (hence Word). */
+extern Word VG_(clo_max_stackframe);
 
 /* Delay startup to allow GDB to be attached?  Default: NO */
 extern Bool VG_(clo_wait_for_gdb);
index 00c7bcba89a77929094e933cd41759e2788d2c02..3c50ce69dfef0f3e6dbb03d513fbe7b7da7246ed 100644 (file)
       (qq_var) = (Int)VG_(atoll)( &qq_arg[ VG_(strlen)(qq_option)+1 ] ); \
    }
 
+/* Same as VG_NUM_CLO but does not coerce the result value to 32 bits
+   on 64-bit platforms. */
+#define VG_NUMW_CLO(qq_arg, qq_option, qq_var) \
+   if (VG_CLO_STREQN(VG_(strlen)(qq_option)+1, qq_arg, qq_option"=")) { \
+      (qq_var) = (Word)VG_(atoll)( &qq_arg[ VG_(strlen)(qq_option)+1 ] ); \
+   }
+
 /* Bounded integer arg */
 #define VG_BNUM_CLO(qq_arg, qq_option, qq_var, qq_lo, qq_hi) \
    if (VG_CLO_STREQN(VG_(strlen)(qq_option)+1, qq_arg, qq_option"=")) { \