This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGa98f394e81f4: [LLDB][GUI] Resolve paths in file/directory fields (authored by OmarEmaraDev, committed by clayborg).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106553/new/ https://reviews.llvm.org/D106553 Files: lldb/source/Core/IOHandlerCursesGUI.cpp Index: lldb/source/Core/IOHandlerCursesGUI.cpp =================================================================== --- lldb/source/Core/IOHandlerCursesGUI.cpp +++ lldb/source/Core/IOHandlerCursesGUI.cpp @@ -1300,8 +1300,11 @@ if (!IsSpecified()) return; - FileSpec file(GetPath()); - if (m_need_to_exist && !FileSystem::Instance().Exists(file)) { + if (!m_need_to_exist) + return; + + FileSpec file = GetResolvedFileSpec(); + if (!FileSystem::Instance().Exists(file)) { SetError("File doesn't exist!"); return; } @@ -1311,7 +1314,17 @@ } } - // Returns the path of the file. + FileSpec GetFileSpec() { + FileSpec file_spec(GetPath()); + return file_spec; + } + + FileSpec GetResolvedFileSpec() { + FileSpec file_spec(GetPath()); + FileSystem::Instance().Resolve(file_spec); + return file_spec; + } + const std::string &GetPath() { return m_content; } protected: @@ -1330,8 +1343,11 @@ if (!IsSpecified()) return; - FileSpec file(GetPath()); - if (m_need_to_exist && !FileSystem::Instance().Exists(file)) { + if (!m_need_to_exist) + return; + + FileSpec file = GetResolvedFileSpec(); + if (!FileSystem::Instance().Exists(file)) { SetError("Directory doesn't exist!"); return; } @@ -1341,7 +1357,17 @@ } } - // Returns the path of the file. + FileSpec GetFileSpec() { + FileSpec file_spec(GetPath()); + return file_spec; + } + + FileSpec GetResolvedFileSpec() { + FileSpec file_spec(GetPath()); + FileSystem::Instance().Resolve(file_spec); + return file_spec; + } + const std::string &GetPath() { return m_content; } protected:
Index: lldb/source/Core/IOHandlerCursesGUI.cpp =================================================================== --- lldb/source/Core/IOHandlerCursesGUI.cpp +++ lldb/source/Core/IOHandlerCursesGUI.cpp @@ -1300,8 +1300,11 @@ if (!IsSpecified()) return; - FileSpec file(GetPath()); - if (m_need_to_exist && !FileSystem::Instance().Exists(file)) { + if (!m_need_to_exist) + return; + + FileSpec file = GetResolvedFileSpec(); + if (!FileSystem::Instance().Exists(file)) { SetError("File doesn't exist!"); return; } @@ -1311,7 +1314,17 @@ } } - // Returns the path of the file. + FileSpec GetFileSpec() { + FileSpec file_spec(GetPath()); + return file_spec; + } + + FileSpec GetResolvedFileSpec() { + FileSpec file_spec(GetPath()); + FileSystem::Instance().Resolve(file_spec); + return file_spec; + } + const std::string &GetPath() { return m_content; } protected: @@ -1330,8 +1343,11 @@ if (!IsSpecified()) return; - FileSpec file(GetPath()); - if (m_need_to_exist && !FileSystem::Instance().Exists(file)) { + if (!m_need_to_exist) + return; + + FileSpec file = GetResolvedFileSpec(); + if (!FileSystem::Instance().Exists(file)) { SetError("Directory doesn't exist!"); return; } @@ -1341,7 +1357,17 @@ } } - // Returns the path of the file. + FileSpec GetFileSpec() { + FileSpec file_spec(GetPath()); + return file_spec; + } + + FileSpec GetResolvedFileSpec() { + FileSpec file_spec(GetPath()); + FileSystem::Instance().Resolve(file_spec); + return file_spec; + } + const std::string &GetPath() { return m_content; } protected:
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits