[llvm-commits] [llvm] r75665 - /llvm/trunk/tools/bugpoint/ToolRunner.cpp
Viktor Kutuzov
vkutuzov at accesssoftek.com
Tue Jul 14 12:11:37 PDT 2009
Author: vkutuzov
Date: Tue Jul 14 14:10:55 2009
New Revision: 75665
URL: http://llvm.org/viewvc/llvm-project?rev=75665&view=rev
Log:
Fix for bugpoint -remote-client
Modified:
llvm/trunk/tools/bugpoint/ToolRunner.cpp
Modified: llvm/trunk/tools/bugpoint/ToolRunner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ToolRunner.cpp?rev=75665&r1=75664&r2=75665&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/ToolRunner.cpp (original)
+++ llvm/trunk/tools/bugpoint/ToolRunner.cpp Tue Jul 14 14:10:55 2009
@@ -635,6 +635,7 @@
std::vector<const char*> ProgramArgs;
+ std::string Exec;
if (RemoteClientPath.isEmpty())
ProgramArgs.push_back(OutputBinary.c_str());
else {
@@ -650,10 +651,10 @@
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 @@
FileRemover OutputBinaryRemover(OutputBinary);
- if (RemoteClientPath.isEmpty())
+ if (RemoteClientPath.isEmpty()) {
+ DEBUG(std::cerr << "<run locally>" << 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 << "<run remotely>" << 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,
More information about the llvm-commits
mailing list