From: Bart Van Assche Date: Tue, 18 Mar 2008 17:08:08 +0000 (+0000) Subject: Added command-line option --show-confl-seg (show conflicting segments). X-Git-Tag: svn/VALGRIND_3_4_0~840 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5a595685b9ce5866f11a35cde2a65d3cd3200c70;p=thirdparty%2Fvalgrind.git Added command-line option --show-confl-seg (show conflicting segments). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7733 --- diff --git a/exp-drd/drd_error.c b/exp-drd/drd_error.c index e68e6a604f..d895a022d4 100644 --- a/exp-drd/drd_error.c +++ b/exp-drd/drd_error.c @@ -39,11 +39,23 @@ #include "pub_tool_tooliface.h" // VG_(needs_tool_errors)() +/* Local type definitions. */ + typedef enum { ConflictingAccessSupp } DRD_SuppKind; +/* Local variables. */ + +static Bool s_drd_show_conflicting_segments = True; + + +void set_show_conflicting_segments(const Bool scs) +{ + s_drd_show_conflicting_segments = scs; +} + /* Describe a data address range [a,a+len[ as good as possible, for error */ /* messages, putting the result in ai. */ static @@ -105,8 +117,11 @@ void drd_report_data_race2(Error* const err, const DataRaceErrInfo* const dri) { VG_(message)(Vg_UserMsg, "Allocation context: unknown."); } - thread_report_conflicting_segments(dri->tid, - dri->addr, dri->size, dri->access_type); + if (s_drd_show_conflicting_segments) + { + thread_report_conflicting_segments(dri->tid, + dri->addr, dri->size, dri->access_type); + } } static Bool drd_tool_error_eq(VgRes res, Error* e1, Error* e2) diff --git a/exp-drd/drd_error.h b/exp-drd/drd_error.h index 5da18b5cc3..1bbd066a22 100644 --- a/exp-drd/drd_error.h +++ b/exp-drd/drd_error.h @@ -120,9 +120,8 @@ typedef struct { typedef struct { } GenericErrInfo; -void describe_addr(Addr const a, SizeT const len, AddrInfo* const ai); -Char* describe_addr_text(Addr const a, SizeT const len, AddrInfo* const ai, - Char* const buf, UInt const n_buf); + +void set_show_conflicting_segments(const Bool scs); void drd_register_error_handlers(void); diff --git a/exp-drd/drd_main.c b/exp-drd/drd_main.c index bec8d81a3e..758edc40a9 100644 --- a/exp-drd/drd_main.c +++ b/exp-drd/drd_main.c @@ -71,6 +71,7 @@ static Addr drd_trace_address = 0; static Bool drd_process_cmd_line_option(Char* arg) { + Bool show_confl_seg = True; Bool trace_barrier = False; Bool trace_clientobj = False; Bool trace_cond = False; @@ -84,6 +85,7 @@ static Bool drd_process_cmd_line_option(Char* arg) Char* trace_address = 0; VG_BOOL_CLO (arg, "--drd-stats", drd_print_stats) + else VG_BOOL_CLO(arg, "--show-confl-seg", show_confl_seg) else VG_BOOL_CLO(arg, "--trace-barrier", trace_barrier) else VG_BOOL_CLO(arg, "--trace-clientobj", trace_clientobj) else VG_BOOL_CLO(arg, "--trace-cond", trace_cond) @@ -100,6 +102,8 @@ static Bool drd_process_cmd_line_option(Char* arg) else return False; + if (! show_confl_seg) + set_show_conflicting_segments(show_confl_seg); if (trace_address) { drd_trace_address = VG_(strtoll16)(trace_address, 0);