summaryrefslogtreecommitdiff
path: root/tools/llvm-db
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-07-28 22:03:44 +0000
committerChris Lattner <sabre@nondot.org>2006-07-28 22:03:44 +0000
commit252ad03d7db0add504fdcc6bd67c1bc1e28bdd57 (patch)
treeb53953cdbf21813671a66e76191e4bd39c4bf6e7 /tools/llvm-db
parent3236ced25f152ca3035b335008056cd91af5f8bf (diff)
downloadllvm-252ad03d7db0add504fdcc6bd67c1bc1e28bdd57.tar.gz
llvm-252ad03d7db0add504fdcc6bd67c1bc1e28bdd57.tar.bz2
llvm-252ad03d7db0add504fdcc6bd67c1bc1e28bdd57.tar.xz
Change Path::getStatusInfo to return a boolean and error string on an error
instead of throwing an exception. This reduces the amount of code that is exposed to exceptions (e.g. FileUtilities), though it is clearly only one step along the way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29395 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-db')
-rw-r--r--tools/llvm-db/Commands.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/llvm-db/Commands.cpp b/tools/llvm-db/Commands.cpp
index 1716e1ba49..da07769fbb 100644
--- a/tools/llvm-db/Commands.cpp
+++ b/tools/llvm-db/Commands.cpp
@@ -49,8 +49,12 @@ void CLIDebugger::startProgramRunning() {
eliminateRunInfo();
// If the program has been modified, reload it!
- sys::Path Program (Dbg.getProgramPath());
- if (TheProgramInfo->getProgramTimeStamp() != Program.getTimestamp()) {
+ sys::Path Program(Dbg.getProgramPath());
+ sys::FileStatus Status;
+ std::string Err;
+ if (Program.getFileStatus(Status, &Err))
+ throw Err;
+ if (TheProgramInfo->getProgramTimeStamp() != Status.getTimestamp()) {
std::cout << "'" << Program << "' has changed; re-reading program.\n";
// Unload an existing program. This kills the program if necessary.