From: Muhammad Omair Javaid Date: Mon, 15 May 2023 10:25:52 +0000 (+0400) Subject: Revert "[lldb] Refactor SBFileSpec::GetDirectory" X-Git-Tag: upstream/17.0.6~8468 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=58e6caaba1cf623292c8898be30a5a56722432b3;p=platform%2Fupstream%2Fllvm.git Revert "[lldb] Refactor SBFileSpec::GetDirectory" This reverts commit 2bea2d7b070dc5df723ce2b92dbc654b8bb1847e. It introduced following failures on buildbot lldb-aarch64-windows: lldb-api :: functionalities/process_save_core/TestProcessSaveCore.py lldb-api :: python_api/symbol-context/TestSymbolContext.py Differential Revision: https://reviews.llvm.org/D149625 --- diff --git a/lldb/source/API/SBFileSpec.cpp b/lldb/source/API/SBFileSpec.cpp index 8668b64..a7df9af 100644 --- a/lldb/source/API/SBFileSpec.cpp +++ b/lldb/source/API/SBFileSpec.cpp @@ -114,7 +114,9 @@ const char *SBFileSpec::GetFilename() const { const char *SBFileSpec::GetDirectory() const { LLDB_INSTRUMENT_VA(this); - return m_opaque_up->GetDirectory().GetCString(); + FileSpec directory{*m_opaque_up}; + directory.ClearFilename(); + return directory.GetPathAsConstString().GetCString(); } void SBFileSpec::SetFilename(const char *filename) {