diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2004-12-13 02:59:15 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2004-12-13 02:59:15 +0000 |
commit | 663601cca6802db04fb161ae3d724673748fee8f (patch) | |
tree | e7fcbb09ace6d037b4c180e573bdbf68fd944b9f /lib/Debugger/ProgramInfo.cpp | |
parent | 5af46883f27eb66ada1ca01e011e80bfb838f08e (diff) |
For PR351: \
* Get file information from a MappedFile instance \
* Convert file type tests to sys::Path form
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18854 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Debugger/ProgramInfo.cpp')
-rw-r--r-- | lib/Debugger/ProgramInfo.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/Debugger/ProgramInfo.cpp b/lib/Debugger/ProgramInfo.cpp index d6a4532b4f..c6e5d32b66 100644 --- a/lib/Debugger/ProgramInfo.cpp +++ b/lib/Debugger/ProgramInfo.cpp @@ -170,11 +170,16 @@ SourceFileInfo::~SourceFileInfo() { SourceFile &SourceFileInfo::getSourceText() const { // FIXME: this should take into account the source search directories! - if (SourceText == 0) // Read the file in if we haven't already. - if (!Directory.empty() && FileOpenable(Directory+"/"+BaseName)) - SourceText = new SourceFile(Directory+"/"+BaseName, Descriptor); + if (SourceText == 0) { // Read the file in if we haven't already. + sys::Path tmpPath; + if (!Directory.empty()) + tmpPath.setDirectory(Directory); + tmpPath.appendFile(BaseName); + if (tmpPath.readable()) + SourceText = new SourceFile(tmpPath.toString(), Descriptor); else SourceText = new SourceFile(BaseName, Descriptor); + } return *SourceText; } |