Files
fail/doc/coverage-experiment-excerpt.cc
hsc b70b6fb43a another directory rename: failstar -> fail
"failstar" sounds like a name for a cruise liner from the 80s.  As "*" isn't a
desirable part of directory names, just name the whole thing "fail/", the core
parts being stored in "fail/core/".

Additionally fixing two build system dependency issues:
 - missing jobserver -> protomessages dependency
 - broken bochs -> fail dependency (add_custom_target DEPENDS only allows plain
   file dependencies ... cmake for the win)


git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@956 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
2012-03-08 19:43:02 +00:00

30 lines
1006 B
C++

// restore previously saved simulator state
RestoreEvent ev_restore("sav/p_entry.sav");
addEventAndWait(&ev_restore);
// breakpoint $instr instructions in the future
BPEvent ev_instr_reached(ANY_ADDR, instr);
addEvent(&ev_instr_reached);
// breakpoint at function exit
BPEvent ev_func_end(INST_ADDR_FUNC_END);
addEvent(&ev_func_end);
// if we reach the exit first, we're done
if (waitAny() == ev_func_end.id()) { break; }
// commission a register bit-flip FI
RegisterBitflip fi_bitflip(*reg, bitnr);
inject(&fi_bitflip);
// catch traps and timeout
TrapEvent ev_trap(ANY_TRAP);
addEvent(&ev_trap);
BPEvent ev_timeout(ANY_ADDR, 1000);
addEvent(&ev_timeout); // [...]
// wait for function exit, trap or timeout
if ((id = waitAny()) == ev_func_end.id()) {
int result = registers(REG_EAX).cur_value();
log(*reg,bitnr,instr,LOG_RESULT,result);
} else if (id == ev_trap.id()) {
log(*reg,bitnr,instr,LOG_TRAP,ev_trap.type());
} else if (id == ev_timeout.id()) {
log(*reg,bitnr,instr,LOG_TIMEOUT); }