Bochs-modifying aspect: never abort/ask the user on what to do
git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1428 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
@ -13,7 +13,8 @@ OPTION(CONFIG_EVENT_JUMP "Event source: Branch instructions" OFF)
|
||||
OPTION(CONFIG_SR_RESTORE "Target backend: State restore" OFF)
|
||||
OPTION(CONFIG_SR_SAVE "Target backend: State saving" OFF)
|
||||
OPTION(CONFIG_SR_REBOOT "Target backend: Reboot" OFF)
|
||||
OPTION(CONFIG_BOCHS_NON_VERBOSE "Misc: Reduced verbosity" OFF)
|
||||
OPTION(CONFIG_BOCHS_NON_VERBOSE "Misc: Reduced verbosity (a lot faster for large campaigns)" OFF)
|
||||
OPTION(CONFIG_BOCHS_NO_ABORT "Misc: Do not abort or ask the user in case the simulator stumbles on unexpected events (e.g., panics)" ON)
|
||||
OPTION(CONFIG_SUPPRESS_INTERRUPTS "Target backend: Suppress interrupts" OFF)
|
||||
OPTION(CONFIG_FIRE_INTERRUPTS "Target backend: Fire interrupts" OFF)
|
||||
OPTION(CONFIG_DISABLE_KEYB_INTERRUPTS "Target backend: Suppress keyboard interrupts" OFF)
|
||||
|
||||
@ -22,6 +22,7 @@
|
||||
|
||||
// Fail configuration
|
||||
#cmakedefine CONFIG_BOCHS_NON_VERBOSE
|
||||
#cmakedefine CONFIG_BOCHS_NO_ABORT
|
||||
#cmakedefine CONFIG_SUPPRESS_INTERRUPTS
|
||||
#cmakedefine CONFIG_FIRE_INTERRUPTS
|
||||
#cmakedefine CONFIG_DISABLE_KEYB_INTERRUPTS
|
||||
|
||||
41
src/core/sal/bochs/BochsNoAbort.ah
Normal file
41
src/core/sal/bochs/BochsNoAbort.ah
Normal file
@ -0,0 +1,41 @@
|
||||
#ifndef __BOCHS_NO_ABORT_AH__
|
||||
#define __BOCHS_NO_ABORT_AH__
|
||||
|
||||
#include "config/FailConfig.hpp"
|
||||
|
||||
#ifdef CONFIG_BOCHS_NO_ABORT
|
||||
|
||||
#include "bochs.h"
|
||||
|
||||
aspect BochsNoAbort {
|
||||
pointcut get_default_action() = "int logfunctions::get_default_action(int)";
|
||||
|
||||
// make sure we're not the innermost aspect
|
||||
advice call(get_default_action()) : order ("BochsNoAbort", "BochsNonVerbose");
|
||||
|
||||
// Needed to prevent Bochs from aborting or interacting with the user (ask
|
||||
// what to do) when any of the Bochs-internal log macros (especially
|
||||
// BX_PANIC) is called. This may leave Bochs in a weird state (see the
|
||||
// example bochsrc that accompanies Bochs, section LOG CONTROL), but is
|
||||
// better than completely terminating the experiment.
|
||||
// FIXME: Probably we should signal a BX_PANIC to the experiment somehow,
|
||||
// instead of continuing simulation?
|
||||
//
|
||||
// Aspect is BochsNonVerbose's little sister.
|
||||
//
|
||||
// This works around the BUG mentioned in bochs/logio.cc /
|
||||
// logfunctions::logfunctions().
|
||||
advice call(get_default_action())
|
||||
: around ()
|
||||
{
|
||||
tjp->proceed();
|
||||
int *action = tjp->result();
|
||||
if (*action == ACT_FATAL || *action == ACT_ASK) {
|
||||
*action = ACT_REPORT;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
#endif // CONFIG_BOCHS_NO_ABORT
|
||||
|
||||
#endif // __BOCHS_NO_ABORT_AH__
|
||||
@ -17,13 +17,21 @@ aspect BochsNonVerbose {
|
||||
|| execution("% logfunctions::info(...)")
|
||||
|| execution("% logfunctions::pass(...)")
|
||||
|| execution("% logfunctions::error(...)")
|
||||
|| execution("% logfunctions::panic(...)")
|
||||
: around () { }
|
||||
};
|
||||
*/
|
||||
|
||||
aspect BochsNonVerbose {
|
||||
pointcut get_default_action() = "int logfunctions::get_default_action(int)";
|
||||
|
||||
// make sure we're the innermost aspect
|
||||
advice call(get_default_action()) : order ("BochsNoAbort", "BochsNonVerbose");
|
||||
|
||||
// needed to suppress Bochs output *before* a state restore finished
|
||||
advice call("int logfunctions::get_default_action(int)")
|
||||
// This works around the BUG mentioned in bochs/logio.cc /
|
||||
// logfunctions::logfunctions().
|
||||
advice call(get_default_action())
|
||||
: around ()
|
||||
{
|
||||
int action;
|
||||
|
||||
Reference in New Issue
Block a user