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 | 3aa1f3ca4fd07aa7142db56c61aeaeb222940534 (patch) | |
tree | 755ac322bde4636f99a7b6da29b66181741f85b1 /llvm/lib/Debugger/ProgramInfo.cpp | |
parent | a204547e325734b75b412eeb5a3019cbedc47f03 (diff) | |
download | bcm5719-llvm-3aa1f3ca4fd07aa7142db56c61aeaeb222940534.tar.gz bcm5719-llvm-3aa1f3ca4fd07aa7142db56c61aeaeb222940534.zip |
For PR351: \
* Get file information from a MappedFile instance \
* Convert file type tests to sys::Path form
llvm-svn: 18854
Diffstat (limited to 'llvm/lib/Debugger/ProgramInfo.cpp')
-rw-r--r-- | llvm/lib/Debugger/ProgramInfo.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/lib/Debugger/ProgramInfo.cpp b/llvm/lib/Debugger/ProgramInfo.cpp index d6a4532b4f5..c6e5d32b666 100644 --- a/llvm/lib/Debugger/ProgramInfo.cpp +++ b/llvm/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; } |