From 7783b055a6693ea213910fa2a0570d4f969d9317 Mon Sep 17 00:00:00 2001 From: bloodstalker Date: Wed, 3 May 2017 01:26:00 +0430 Subject: hijack main now works --- bruiser/bruiser.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bruiser/bruiser.cpp b/bruiser/bruiser.cpp index 7b6ddc3..50760f3 100644 --- a/bruiser/bruiser.cpp +++ b/bruiser/bruiser.cpp @@ -51,7 +51,7 @@ using namespace clang::driver; using namespace clang::tooling; /**********************************************************************************************************************/ #define __DBG_1 -#if 0 +#if 1 #undef __DBG_1 #endif /**********************************************************************************************************************/ @@ -325,6 +325,8 @@ int main(int argc, const char **argv) bruiser::ShellHistory shHistory; int InKey; + CommonOptionsParser op(argc, argv, BruiserCategory); + { char command[130]; while(true) @@ -383,11 +385,10 @@ int main(int argc, const char **argv) if (std::strcmp(command, "hijack main") == 0) { - CommonOptionsParser op(argc, argv, BruiserCategory); ClangTool Tool(op.getCompilations(), op.getSourcePathList()); RunResult = Tool.run(newFrontendActionFactory().get()); - std::cout << CYAN <<"hijacking main returned " << RunResult << "\n"; + std::cout << CYAN <<"hijacking main returned " << RunResult << "\n" << NORMAL; continue; } -- cgit v1.2.3