Author: Muhammad Omair Javaid
Date: 2023-11-20T11:12:34+05:00
New Revision: c1fe1900491ae773e45e41604af25312e5fc6559

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

LOG: Revert "Add new API in SBTarget for loading core from SBFile (#71769)"

This reverts commit e2fb816c4f0286ddf8b1030148a343d5efc14e01.
It breaks TestLinuxCore.py on lldb-*-windows. See buildbot below:
https://lab.llvm.org/buildbot/#/builders/219/builds/7014

Added: 
    

Modified: 
    lldb/include/lldb/API/SBTarget.h
    lldb/source/API/SBTarget.cpp
    lldb/test/API/functionalities/postmortem/elf-core/TestLinuxCore.py

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/API/SBTarget.h 
b/lldb/include/lldb/API/SBTarget.h
index 8e44cd5513c5b20..83087623088c5b4 100644
--- a/lldb/include/lldb/API/SBTarget.h
+++ b/lldb/include/lldb/API/SBTarget.h
@@ -184,7 +184,6 @@ class LLDB_API SBTarget {
 
   SBProcess LoadCore(const char *core_file);
   SBProcess LoadCore(const char *core_file, lldb::SBError &error);
-  SBProcess LoadCore(const SBFile &file, lldb::SBError &error);
 
   /// Launch a new process with sensible defaults.
   ///

diff  --git a/lldb/source/API/SBTarget.cpp b/lldb/source/API/SBTarget.cpp
index 9632627e3cefc42..2d029554492a05c 100644
--- a/lldb/source/API/SBTarget.cpp
+++ b/lldb/source/API/SBTarget.cpp
@@ -16,7 +16,6 @@
 #include "lldb/API/SBEnvironment.h"
 #include "lldb/API/SBEvent.h"
 #include "lldb/API/SBExpressionOptions.h"
-#include "lldb/API/SBFile.h"
 #include "lldb/API/SBFileSpec.h"
 #include "lldb/API/SBListener.h"
 #include "lldb/API/SBModule.h"
@@ -261,31 +260,6 @@ SBProcess SBTarget::LoadCore(const char *core_file, 
lldb::SBError &error) {
   return sb_process;
 }
 
-SBProcess SBTarget::LoadCore(const SBFile &file, lldb::SBError &error) {
-  LLDB_INSTRUMENT_VA(this, file, error);
-
-  SBProcess sb_process;
-  TargetSP target_sp(GetSP());
-  if (target_sp) {
-    FileSP file_sp = file.GetFile();
-    FileSpec filespec;
-    file_sp->GetFileSpec(filespec);
-    FileSystem::Instance().Resolve(filespec);
-    ProcessSP process_sp(target_sp->CreateProcess(
-        target_sp->GetDebugger().GetListener(), "", &filespec, false));
-    if (process_sp) {
-      error.SetError(process_sp->LoadCore());
-      if (error.Success())
-        sb_process.SetSP(process_sp);
-    } else {
-      error.SetErrorString("Failed to create the process");
-    }
-  } else {
-    error.SetErrorString("SBTarget is invalid");
-  }
-  return sb_process;
-}
-
 SBProcess SBTarget::LaunchSimple(char const **argv, char const **envp,
                                  const char *working_directory) {
   LLDB_INSTRUMENT_VA(this, argv, envp, working_directory);

diff  --git 
a/lldb/test/API/functionalities/postmortem/elf-core/TestLinuxCore.py 
b/lldb/test/API/functionalities/postmortem/elf-core/TestLinuxCore.py
index a6a8518f9397da3..58f104eb49de245 100644
--- a/lldb/test/API/functionalities/postmortem/elf-core/TestLinuxCore.py
+++ b/lldb/test/API/functionalities/postmortem/elf-core/TestLinuxCore.py
@@ -53,11 +53,6 @@ def test_x86_64(self):
         """Test that lldb can read the process information from an x86_64 
linux core file."""
         self.do_test("linux-x86_64", self._x86_64_pid, self._x86_64_regions, 
"a.out")
 
-    @skipIfLLVMTargetMissing("X86")
-    def test_x86_64_fd(self):
-        """Test that lldb can read the process information from an x86_64 
linux core file."""
-        self.do_test_fd("linux-x86_64", self._x86_64_pid, 
self._x86_64_regions, "a.out")
-
     @skipIfLLVMTargetMissing("SystemZ")
     def test_s390x(self):
         """Test that lldb can read the process information from an s390x linux 
core file."""
@@ -762,19 +757,6 @@ def do_test(self, filename, pid, region_count, 
thread_name):
 
         self.dbg.DeleteTarget(target)
 
-    def do_test_fd(self, filename, pid, region_count, thread_name):
-        file_object = open(filename + ".core", "r")
-        fd = file_object.fileno()
-        file = lldb.SBFile(fd, "r", True)
-        target = self.dbg.CreateTarget(filename + ".out")
-        error = lldb.SBError()
-        process = target.LoadCore(file, error)
-
-        self.check_all(process, pid, region_count, thread_name)
-
-        self.dbg.DeleteTarget(target)
-
-
 
 def replace_path(binary, replace_from, replace_to):
     src = replace_from.encode()


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

Reply via email to