X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=datarace.cc;h=9f75642e27a5a670d30e0c9284e6162cfa8047de;hb=5178739a27add5e59a1213c9ac90e73397c1a23d;hp=1ec43be4e8cb72dc246782635fd6497ac8e6ffb3;hpb=e7c0c2dc248559b307122db7923df35f7c6d957e;p=model-checker.git diff --git a/datarace.cc b/datarace.cc index 1ec43be..9f75642 100644 --- a/datarace.cc +++ b/datarace.cc @@ -9,7 +9,7 @@ #include "action.h" struct ShadowTable *root; -std::vector unrealizedraces; +SnapVector unrealizedraces; void *memory_base; void *memory_top; @@ -150,16 +150,18 @@ bool checkDataRaces() */ void assert_race(struct DataRace *race) { - char buf[200]; - char *ptr = buf; - ptr += sprintf(ptr, "Data race detected @ address %p:\n", race->address); - ptr += sprintf(ptr, " Access 1: %5s in thread %2d @ clock %3u\n", + model->assert_bug( + "Data race detected @ address %p:\n" + " Access 1: %5s in thread %2d @ clock %3u\n" + " Access 2: %5s in thread %2d @ clock %3u", + race->address, race->isoldwrite ? "write" : "read", - id_to_int(race->oldthread), race->oldclock); - ptr += sprintf(ptr, " Access 2: %5s in thread %2d @ clock %3u", + id_to_int(race->oldthread), + race->oldclock, race->isnewwrite ? "write" : "read", - id_to_int(race->newaction->get_tid()), race->newaction->get_seq_number()); - model->assert_bug(buf); + id_to_int(race->newaction->get_tid()), + race->newaction->get_seq_number() + ); } /** This function does race detection for a write on an expanded record. */