action: print '?' for unknown read-from-future
authorBrian Norris <banorris@uci.edu>
Tue, 4 Sep 2012 17:59:47 +0000 (10:59 -0700)
committerBrian Norris <banorris@uci.edu>
Tue, 4 Sep 2012 19:06:57 +0000 (12:06 -0700)
To provide more informative debugging traces, use a placeholder '?' as the "Rf"
value when printing a 'read' ModelAction that has no reads-from value. This
helps, for instance, when manually identifying problem points in an infeasible
execution.

action.cc

index a321a85edede7f0b12a47142f61e44a33f561cbd..692d14cf03033d4b3c89ed7e05a7d386acdfe352 100644 (file)
--- a/action.cc
+++ b/action.cc
@@ -265,8 +265,12 @@ void ModelAction::print(void) const
 
        printf("(%3d) Thread: %-2d   Action: %-13s   MO: %7s  Loc: %14p  Value: %-12" PRIu64,
                        seq_number, id_to_int(tid), type_str, mo_str, location, valuetoprint);
 
        printf("(%3d) Thread: %-2d   Action: %-13s   MO: %7s  Loc: %14p  Value: %-12" PRIu64,
                        seq_number, id_to_int(tid), type_str, mo_str, location, valuetoprint);
-       if (reads_from)
-               printf(" Rf: %d", reads_from->get_seq_number());
+       if (is_read()) {
+               if (reads_from)
+                       printf(" Rf: %d", reads_from->get_seq_number());
+               else
+                       printf(" Rf: ?");
+       }
        if (cv) {
                printf("\t");
                cv->print();
        if (cv) {
                printf("\t");
                cv->print();