static inline
void check_load_or_store(Bool is_write, Addr m, UWord sz, Seg* mptr_vseg)
{
- if (h_clo_lossage_check) {
- tl_assert(0);
#if 0
+ tl_assert(0);
+ if (h_clo_lossage_check) {
Seg* seg;
stats__tot_mem_refs++;
if (ISList__findI0( seglist, (Addr)m, &seg )) {
}
}
}
-#endif
} /* clo_lossage_check */
+#endif
# if SC_SEGS
checkSeg(mptr_vseg);
stats__segs_allocd, stats__segs_recycled);
}
+#if 0
if (h_clo_lossage_check) {
VG_(message)(Vg_UserMsg, "");
VG_(message)(Vg_UserMsg, "%12lld total memory references",
} else {
tl_assert( 0 == VG_(OSetGen_Size)(lossage) );
}
+#endif
}
// //
//////////////////////////////////////////////////////////////
-Bool h_clo_partial_loads_ok = True; /* user visible */
-Bool h_clo_lossage_check = False; /* dev flag only */
+Bool h_clo_partial_loads_ok = True; /* user visible */
+/* Bool h_clo_lossage_check = False; */ /* dev flag only */
+Bool sg_clo_enable_sg_checks = True; /* user visible */
Bool pc_process_cmd_line_options(Char* arg)
{
VG_BOOL_CLO(arg, "--partial-loads-ok", h_clo_partial_loads_ok)
- else VG_BOOL_CLO(arg, "--lossage-check", h_clo_lossage_check)
+ /* else VG_BOOL_CLO(arg, "--lossage-check", h_clo_lossage_check) */
+ else VG_BOOL_CLO(arg, "--enable-sg-checks", sg_clo_enable_sg_checks)
else
return VG_(replacement_malloc_process_cmd_line_option)(arg);
void pc_print_usage(void)
{
VG_(printf)(
- " --partial-loads-ok=no|yes same as for Memcheck [yes]\n"
+ " --partial-loads-ok=no|yes same as for Memcheck [yes]\n"
+ " --enable-sg-checks=no|yes enable stack & global array checking? [yes]\n"
);
VG_(replacement_malloc_print_usage)();
}
void pc_print_debug_usage(void)
{
+ /*
VG_(printf)(
- " --lossage-check=no|yes gather stats for quality control [no]\n"
+ " --lossage-check=no|yes gather stats for quality control [no]\n"
);
+ */
VG_(replacement_malloc_print_debug_usage)();
}
void pc_print_extra_suppression_info ( Error* err );
extern Bool h_clo_partial_loads_ok;
-extern Bool h_clo_lossage_check;
+/* extern Bool h_clo_lossage_check; */
+extern Bool sg_clo_enable_sg_checks;
Bool pc_process_cmd_line_options(Char* arg);
void pc_print_usage(void);
#include "pub_tool_basics.h"
#include "pub_tool_libcassert.h"
+#include "pub_tool_libcprint.h"
#include "pub_tool_execontext.h"
#include "pub_tool_tooliface.h"
#include "pub_tool_options.h"
-//#include "h_list.h" // Seg
#include "sg_main.h"
#include "pc_common.h"
#include "h_main.h"
{
h_post_clo_init();
sg_post_clo_init();
+# if defined(VGA_x86) || defined(VGA_amd64)
+ /* nothing */
+# elif defined(VGA_ppc32) || defined(VGA_ppc64)
+ if (VG_(clo_verbosity) >= 1 && sg_clo_enable_sg_checks) {
+ VG_(message)(Vg_UserMsg,
+ "WARNING: exp-ptrcheck on ppc32/ppc64 platforms: stack and global array");
+ VG_(message)(Vg_UserMsg,
+ "WARNING: checking is not currently supported. Only heap checking is");
+ VG_(message)(Vg_UserMsg,
+ "WARNING: supported. Disabling s/g checks (like --enable-sg-checks=no).");
+ }
+ sg_clo_enable_sg_checks = False;
+# else
+# error "Unsupported architecture"
+# endif
}
static void pc_pre_clo_init(void)
VexGuestLayout* layout,
IRType gWordTy, IRType hWordTy )
{
+ if (!sg_clo_enable_sg_checks)
+ return;
+
tl_assert(st);
tl_assert(isFlatIRStmt(st));
switch (st->tag) {
VexGuestLayout* layout,
IRType gWordTy, IRType hWordTy )
{
+ if (!sg_clo_enable_sg_checks)
+ return;
+
if (jumpkind == Ijk_Call) {
// Assumes x86 or amd64
IRTemp sp_post_call_insn, fp_post_call_insn;