----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: http://reviews.gem5.org/r/2164/#review4932 -----------------------------------------------------------
It's not strictly a replacement for assert, since asserts get compiled out in gem5.fast. Do we need an assert_if() as well? That would certainly be more complete... - Steve Reinhardt On Feb. 27, 2014, 5:51 a.m., Andreas Hansson wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > http://reviews.gem5.org/r/2164/ > ----------------------------------------------------------- > > (Updated Feb. 27, 2014, 5:51 a.m.) > > > Review request for Default. > > > Repository: gem5 > > > Description > ------- > > Changeset 10097:fc78856486a9 > --------------------------- > misc: Add panic_if / fatal_if replacement for if(foo) ... assert(!foo) > > This snippet can be used to replace asserts and have them behave like if + > panic constructs. The interface is as follows: > > panic_if(foo != bar, "These should be equal: foo %i bar %i", foo, bar); > > panic_unless would be a more straightforward replacement for assert, but is > more clumsy than panic_if(!foo,...). > > > Diffs > ----- > > src/base/misc.hh 9c55c0214404 > > Diff: http://reviews.gem5.org/r/2164/diff/ > > > Testing > ------- > > All regressions pass (as it does not affect existing code). > > > Thanks, > > Andreas Hansson > > _______________________________________________ gem5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/gem5-dev
