From 672a04a0620a9fbad1c01965cab4089c58b8e581 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Tue, 4 Sep 2012 10:59:47 -0700 Subject: [PATCH] action: print '?' for unknown read-from-future 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 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/action.cc b/action.cc index a321a85..692d14c 100644 --- 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); - 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(); -- 2.34.1