From 699220b64fd6335cc678f830bb35aa5952d354e7 Mon Sep 17 00:00:00 2001 From: Viktor Kutuzov Date: Tue, 14 Jul 2009 19:10:55 +0000 Subject: [PATCH] Fix for bugpoint -remote-client git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75665 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/bugpoint/ToolRunner.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/tools/bugpoint/ToolRunner.cpp b/tools/bugpoint/ToolRunner.cpp index e00a2b93a0a..503a5dda136 100644 --- a/tools/bugpoint/ToolRunner.cpp +++ b/tools/bugpoint/ToolRunner.cpp @@ -635,6 +635,7 @@ int GCC::ExecuteProgram(const std::string &ProgramFile, std::vector ProgramArgs; + std::string Exec; if (RemoteClientPath.isEmpty()) ProgramArgs.push_back(OutputBinary.c_str()); else { @@ -650,10 +651,10 @@ int GCC::ExecuteProgram(const std::string &ProgramFile, ProgramArgs.push_back(RemoteExtra.c_str()); } + // Full path to the binary char* env_pwd = getenv("PWD"); - std::string Exec = "cd "; Exec += env_pwd; - Exec += "; ./"; + Exec += "/"; Exec += OutputBinary.c_str(); ProgramArgs.push_back(Exec.c_str()); } @@ -673,14 +674,21 @@ int GCC::ExecuteProgram(const std::string &ProgramFile, FileRemover OutputBinaryRemover(OutputBinary); - if (RemoteClientPath.isEmpty()) + if (RemoteClientPath.isEmpty()) { + DEBUG(std::cerr << "" << std::flush;); return RunProgramWithTimeout(OutputBinary, &ProgramArgs[0], sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile), Timeout, MemoryLimit); - else - return RunProgramWithTimeout(sys::Path(RemoteClientPath), &ProgramArgs[0], - sys::Path(InputFile), sys::Path(OutputFile), sys::Path(OutputFile), - Timeout, MemoryLimit); + } else { + std::cout << "" << std::flush; + int RemoteClientStatus = RunProgramWithTimeout(sys::Path(RemoteClientPath), + &ProgramArgs[0], sys::Path(InputFile), sys::Path(OutputFile), + sys::Path(OutputFile), Timeout, MemoryLimit); + if (RemoteClientStatus != 0) { + std::cerr << "Remote Client failed with an error: " << + RemoteClientStatus << ".\n" << std::flush; + } + } } int GCC::MakeSharedObject(const std::string &InputFile, FileType fileType, -- 2.34.1