From 663601cca6802db04fb161ae3d724673748fee8f Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Mon, 13 Dec 2004 02:59:15 +0000 Subject: 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 --- lib/Debugger/ProgramInfo.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lib/Debugger/ProgramInfo.cpp') 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; } -- cgit v1.2.3-18-g5258