Esempio n. 1
0
static void pc_pre_clo_init(void)
{
#if defined(VGO_darwin)
   // This makes the (all-failing) regtests run much faster.
   VG_(printf)("Ptrcheck doesn't work on Darwin yet, sorry.\n");
   VG_(exit)(1);
#endif

   VG_(details_name)            ("exp-ptrcheck");
   VG_(details_version)         (NULL);
   VG_(details_description)     ("a heap, stack & global array "
                                 "overrun detector");
   VG_(details_copyright_author)(
      "Copyright (C) 2003-2009, and GNU GPL'd, by OpenWorks Ltd et al.");
   VG_(details_bug_reports_to)  (VG_BUGS_TO);
   VG_(details_avg_translation_sizeB) ( 496 );

   VG_(basic_tool_funcs)        (pc_post_clo_init,
                                 h_instrument,
                                 pc_fini);

   VG_(needs_malloc_replacement)( h_replace_malloc,
                                  h_replace___builtin_new,
                                  h_replace___builtin_vec_new,
                                  h_replace_memalign,
                                  h_replace_calloc,
                                  h_replace_free,
                                  h_replace___builtin_delete,
                                  h_replace___builtin_vec_delete,
                                  h_replace_realloc,
                                  h_replace_malloc_usable_size,
                                  0 /* no need for client heap redzones */ );

   VG_(needs_var_info)          ();

   VG_(needs_core_errors)       ();
   VG_(needs_tool_errors)       (pc_eq_Error,
                                 pc_before_pp_Error,
                                 pc_pp_Error,
                                 True,/*show TIDs for errors*/
                                 pc_update_Error_extra,
                                 pc_is_recognised_suppression,
                                 pc_read_extra_suppression_info,
                                 pc_error_matches_suppression,
                                 pc_get_error_name,
                                 pc_print_extra_suppression_info);

   VG_(needs_xml_output)        ();

   VG_(needs_syscall_wrapper)( h_pre_syscall,
                               h_post_syscall );

   VG_(needs_command_line_options)( pc_process_cmd_line_options,
                                    pc_print_usage,
                                    pc_print_debug_usage );

   VG_(track_die_mem_stack)        ( pc_die_mem_stack );
   VG_(track_pre_thread_ll_create) ( pc_pre_thread_ll_create );
   VG_(track_pre_thread_first_insn)( pc_pre_thread_first_insn );

   VG_(track_new_mem_mmap)         ( pc_new_mem_mmap );
   VG_(track_new_mem_startup)      ( pc_new_mem_startup);
   VG_(track_die_mem_munmap)       ( pc_die_mem_munmap );

   VG_(track_pre_mem_read)         ( pc_pre_mem_read );
   VG_(track_pre_mem_read_asciiz)  ( pc_pre_mem_read_asciiz );
   VG_(track_pre_mem_write)        ( pc_pre_mem_write );

   VG_(track_post_reg_write_clientcall_return) ( h_post_reg_write_clientcall );
   VG_(track_post_reg_write)( h_post_reg_write_demux );

   h_pre_clo_init();
   sg_pre_clo_init();

   VG_(clo_vex_control).iropt_unroll_thresh = 0;
   VG_(clo_vex_control).guest_chase_thresh = 0;
}
Esempio n. 2
0
static void pc_pre_clo_init(void)
{
#if defined(VGO_darwin)
    // This makes the (all-failing) regtests run much faster.
    VG_(printf)("SGCheck doesn't work on Darwin yet, sorry.\n");
    VG_(exit)(1);
#endif
#if defined(VGA_s390x)
    /* fixs390: to be done. */
    VG_(printf)("SGCheck doesn't work on s390x yet, sorry.\n");
    VG_(exit)(1);
#endif
#if defined(VGA_ppc32) || defined(VGA_ppc64be) || defined(VGA_ppc64le)
    VG_(printf)("SGCheck doesn't work on PPC yet, sorry.\n");
    VG_(exit)(1);
#endif
#if defined(VGA_arm) || defined(VGA_arm64)
    VG_(printf)("SGCheck doesn't work on ARM yet, sorry.\n");
    VG_(exit)(1);
#endif
#if defined(VGA_mips32) || defined(VGA_mips64)
    VG_(printf)("SGCheck doesn't work on MIPS yet, sorry.\n");
    VG_(exit)(1);
#endif
#if defined(VGA_tilegx)
    VG_(printf)("SGCheck doesn't work on TileGx yet, sorry.\n");
    VG_(exit)(1);
#endif

    // Can't change the name until we change the names in suppressions
    // too.
    VG_(details_name)            ("exp-sgcheck");
    VG_(details_version)         (NULL);
    VG_(details_description)     ("a stack and global array "
                                  "overrun detector");
    VG_(details_copyright_author)(
        "Copyright (C) 2003-2015, and GNU GPL'd, by OpenWorks Ltd et al.");
    VG_(details_bug_reports_to)  (VG_BUGS_TO);
    VG_(details_avg_translation_sizeB) ( 496 );

    VG_(basic_tool_funcs)        (sg_post_clo_init,
                                  h_instrument,
                                  sg_fini);

    VG_(needs_malloc_replacement)( h_replace_malloc,
                                   h_replace___builtin_new,
                                   h_replace___builtin_vec_new,
                                   h_replace_memalign,
                                   h_replace_calloc,
                                   h_replace_free,
                                   h_replace___builtin_delete,
                                   h_replace___builtin_vec_delete,
                                   h_replace_realloc,
                                   h_replace_malloc_usable_size,
                                   h_replace_rte_malloc,
                                   h_replace_rte_calloc,
                                   h_replace_rte_zmalloc,
                                   h_replace_rte_realloc,
                                   h_replace_rte_malloc_socket,
                                   h_replace_rte_calloc_socket,
                                   h_replace_rte_zmalloc_socket,
                                   h_replace_rte_free,
                                   0 /* no need for client heap redzones */ );

    VG_(needs_var_info)          ();

    VG_(needs_core_errors)       ();
    VG_(needs_tool_errors)       (pc_eq_Error,
                                  pc_before_pp_Error,
                                  pc_pp_Error,
                                  True,/*show TIDs for errors*/
                                  pc_update_Error_extra,
                                  pc_is_recognised_suppression,
                                  pc_read_extra_suppression_info,
                                  pc_error_matches_suppression,
                                  pc_get_error_name,
                                  pc_get_extra_suppression_info,
                                  pc_print_extra_suppression_use,
                                  pc_update_extra_suppression_use);

    VG_(needs_xml_output)        ();

    //VG_(needs_syscall_wrapper)( h_pre_syscall,
    //                            h_post_syscall );

    VG_(needs_command_line_options)( pc_process_cmd_line_options,
                                     pc_print_usage,
                                     pc_print_debug_usage );

    VG_(track_die_mem_stack)        ( sg_die_mem_stack );
    VG_(track_pre_thread_ll_create) ( sg_pre_thread_ll_create );
    VG_(track_pre_thread_first_insn)( sg_pre_thread_first_insn );

    VG_(track_new_mem_mmap)         ( sg_new_mem_mmap );
    VG_(track_new_mem_startup)      ( sg_new_mem_startup);
    VG_(track_die_mem_munmap)       ( sg_die_mem_munmap );

    /* Really we ought to give handlers for these, to
       check that syscalls don't read across array boundaries. */
    /*
    VG_(track_pre_mem_read)         ( NULL );
    VG_(track_pre_mem_read_asciiz)  ( NULL );
    VG_(track_pre_mem_write)        ( NULL );
    */

    sg_pre_clo_init();

    VG_(clo_vex_control).iropt_unroll_thresh = 0;
    VG_(clo_vex_control).guest_chase_thresh = 0;
}