diff --git a/debuggers/openocd/openocd_wrapper.cc b/debuggers/openocd/openocd_wrapper.cc index accea747..197ce1e3 100644 --- a/debuggers/openocd/openocd_wrapper.cc +++ b/debuggers/openocd/openocd_wrapper.cc @@ -46,6 +46,7 @@ using std::dec; * Flag for finishing main loop execution. */ static bool oocdw_exection_finished = false; +static int oocdw_exCode; /* * Initially set target struct pointers for use in @@ -334,12 +335,7 @@ int main(int argc, char *argv[]) LOG << "finished" << endl; - /* - * Return to experiment flow to properly exit execution - */ - fail::simulator.resume(); - - return 0; + exit(oocdw_exCode); } @@ -598,9 +594,10 @@ void oocdw_write_reg(uint32_t reg_num, enum arm_reg_group rg, uint32_t data) reg->type->set(reg, (uint8_t*)(&data)); } -void oocdw_finish() +void oocdw_finish(int exCode) { oocdw_exection_finished = true; + oocdw_exCode = exCode; } void oocdw_read_from_memory(uint32_t address, uint32_t chunk_size, diff --git a/debuggers/openocd/openocd_wrapper.hpp.in b/debuggers/openocd/openocd_wrapper.hpp.in index 6042c36b..8191dfac 100644 --- a/debuggers/openocd/openocd_wrapper.hpp.in +++ b/debuggers/openocd/openocd_wrapper.hpp.in @@ -2,6 +2,7 @@ #define __OOCD_WRAPPER_H_ #include +#include #define OOCD_CONF_FILE_PATH "@OOCD_CONF_FILE_PATH@" #define OOCD_CONF_FILES_PATH "@OOCD_CONF_FILES_PATH@" @@ -81,7 +82,7 @@ void oocdw_reboot(); * Before returning, another coroutine-switch is called, so the * experiment is able to exit in desired state. */ -void oocdw_finish(); +void oocdw_finish(int exCode = EXIT_SUCCESS); /* * Read data from pandaboard memory diff --git a/src/core/comm/CMakeLists.txt b/src/core/comm/CMakeLists.txt index 2672a757..8f353689 100644 --- a/src/core/comm/CMakeLists.txt +++ b/src/core/comm/CMakeLists.txt @@ -9,7 +9,6 @@ set(PROTOS FailControlMessage.proto DatabaseCampaignMessage.proto TracePlugin.proto - HopChain.proto ) #### PROTOBUFS #### diff --git a/src/core/sal/panda/PandaController.cc b/src/core/sal/panda/PandaController.cc index 5b47d829..a0f88fa6 100644 --- a/src/core/sal/panda/PandaController.cc +++ b/src/core/sal/panda/PandaController.cc @@ -89,12 +89,12 @@ void PandaController::reboot() void PandaController::terminate(int exCode) { - oocdw_finish(); + oocdw_finish(exCode); /* * Resume to let OpenOCD terminate properly + * This call does not return! */ m_Flows.resume(); - SimulatorController::terminate(exCode); } } // end-of-namespace: fail