Author: Muhammad Omair Javaid
Date: 2023-05-15T22:49:00+04:00
New Revision: 58e6caaba1cf623292c8898be30a5a56722432b3

URL: 
https://github.com/llvm/llvm-project/commit/58e6caaba1cf623292c8898be30a5a56722432b3
DIFF: 
https://github.com/llvm/llvm-project/commit/58e6caaba1cf623292c8898be30a5a56722432b3.diff

LOG: 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

Added: 
    

Modified: 
    lldb/source/API/SBFileSpec.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/API/SBFileSpec.cpp b/lldb/source/API/SBFileSpec.cpp
index 8668b64b4ce76..a7df9afc4b8eb 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) {


        
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to