X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=tools%2Fllvm-db%2FCommands.cpp;h=ffebdd5d58f4bedfb0d2d304ed7625c9b6694d8f;hb=5a377cb27bb65ea608b63716454c9ae214ef81c9;hp=da07769fbb083ce4f44749775e62586d1b4f64b4;hpb=252ad03d7db0add504fdcc6bd67c1bc1e28bdd57;p=oota-llvm.git diff --git a/tools/llvm-db/Commands.cpp b/tools/llvm-db/Commands.cpp index da07769fbb0..ffebdd5d58f 100644 --- a/tools/llvm-db/Commands.cpp +++ b/tools/llvm-db/Commands.cpp @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file was developed by the LLVM research group and is distributed under -// the University of Illinois Open Source License. See LICENSE.TXT for details. +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // @@ -21,6 +21,7 @@ #include "llvm/Support/FileUtilities.h" #include "llvm/ADT/StringExtras.h" #include +#include using namespace llvm; /// getCurrentLanguage - Return the current source language that the user is @@ -49,12 +50,12 @@ void CLIDebugger::startProgramRunning() { eliminateRunInfo(); // If the program has been modified, reload it! - sys::Path Program(Dbg.getProgramPath()); - sys::FileStatus Status; + sys::PathWithStatus Program(Dbg.getProgramPath()); std::string Err; - if (Program.getFileStatus(Status, &Err)) + const sys::FileStatus *Status = Program.getFileStatus(false, &Err); + if (!Status) throw Err; - if (TheProgramInfo->getProgramTimeStamp() != Status.getTimestamp()) { + if (TheProgramInfo->getProgramTimeStamp() != Status->getTimestamp()) { std::cout << "'" << Program << "' has changed; re-reading program.\n"; // Unload an existing program. This kills the program if necessary. @@ -219,7 +220,7 @@ void CLIDebugger::parseProgramOptions(std::string &Options) { /// file command - If the user specifies an option, search the PATH for the -/// specified program/bytecode file and load it. If the user does not specify +/// specified program/bitcode file and load it. If the user does not specify /// an option, unload the current program. void CLIDebugger::fileCommand(std::string &Options) { std::string Prog = getToken(Options); @@ -448,11 +449,12 @@ void CLIDebugger::downCommand(std::string &Options) { unsigned CurFrame = RI.getCurrentFrameIdx(); // Check to see if we can go up the specified number of frames. - if (CurFrame < Num) + if (CurFrame < Num) { if (Num == 1) throw "Bottom (i.e., innermost) frame selected; you cannot go down."; else throw "Cannot go down " + utostr(Num) + " frames!"; + } RI.setCurrentFrameIdx(CurFrame-Num); printProgramLocation();