From 1e6b5bf8d64fa1c62fb37d6b6da4d359b8c08cea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 11 Apr 2010 13:20:15 +0200 Subject: [PATCH] Add missing file --- tools/unstuck.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 tools/unstuck.cpp diff --git a/tools/unstuck.cpp b/tools/unstuck.cpp new file mode 100644 index 000000000..6788e954b --- /dev/null +++ b/tools/unstuck.cpp @@ -0,0 +1,41 @@ +// Make stuck DF run again. + +#include +#include +#include +#include +#include +#include +using namespace std; + +#include +#include + +int main (void) +{ + string blah; + DFHack::API DF("Memory.xml"); + try + { + DF.Attach(); + } + catch (exception& e) + { + cerr << e.what() << endl; + #ifndef LINUX_BUILD + cin.ignore(); + #endif + return 1; + } + + DF.ForceResume(); + cout << "DF should be running again :)" << endl; + getline(cin, blah); + + if(!DF.Detach()) + { + cerr << "Can't detach from DF" << endl; + return 1; + } + return 0; +}