Skip to content

Commit c1fe190

Browse files
committed
Revert "Add new API in SBTarget for loading core from SBFile (#71769)"
This reverts commit e2fb816. It breaks TestLinuxCore.py on lldb-*-windows. See buildbot below: https://lab.llvm.org/buildbot/#/builders/219/builds/7014
1 parent 7cc54da commit c1fe190

File tree

3 files changed

+0
-45
lines changed

3 files changed

+0
-45
lines changed

lldb/include/lldb/API/SBTarget.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ class LLDB_API SBTarget {
184184

185185
SBProcess LoadCore(const char *core_file);
186186
SBProcess LoadCore(const char *core_file, lldb::SBError &error);
187-
SBProcess LoadCore(const SBFile &file, lldb::SBError &error);
188187

189188
/// Launch a new process with sensible defaults.
190189
///

lldb/source/API/SBTarget.cpp

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "lldb/API/SBEnvironment.h"
1717
#include "lldb/API/SBEvent.h"
1818
#include "lldb/API/SBExpressionOptions.h"
19-
#include "lldb/API/SBFile.h"
2019
#include "lldb/API/SBFileSpec.h"
2120
#include "lldb/API/SBListener.h"
2221
#include "lldb/API/SBModule.h"
@@ -261,31 +260,6 @@ SBProcess SBTarget::LoadCore(const char *core_file, lldb::SBError &error) {
261260
return sb_process;
262261
}
263262

264-
SBProcess SBTarget::LoadCore(const SBFile &file, lldb::SBError &error) {
265-
LLDB_INSTRUMENT_VA(this, file, error);
266-
267-
SBProcess sb_process;
268-
TargetSP target_sp(GetSP());
269-
if (target_sp) {
270-
FileSP file_sp = file.GetFile();
271-
FileSpec filespec;
272-
file_sp->GetFileSpec(filespec);
273-
FileSystem::Instance().Resolve(filespec);
274-
ProcessSP process_sp(target_sp->CreateProcess(
275-
target_sp->GetDebugger().GetListener(), "", &filespec, false));
276-
if (process_sp) {
277-
error.SetError(process_sp->LoadCore());
278-
if (error.Success())
279-
sb_process.SetSP(process_sp);
280-
} else {
281-
error.SetErrorString("Failed to create the process");
282-
}
283-
} else {
284-
error.SetErrorString("SBTarget is invalid");
285-
}
286-
return sb_process;
287-
}
288-
289263
SBProcess SBTarget::LaunchSimple(char const **argv, char const **envp,
290264
const char *working_directory) {
291265
LLDB_INSTRUMENT_VA(this, argv, envp, working_directory);

lldb/test/API/functionalities/postmortem/elf-core/TestLinuxCore.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,6 @@ def test_x86_64(self):
5353
"""Test that lldb can read the process information from an x86_64 linux core file."""
5454
self.do_test("linux-x86_64", self._x86_64_pid, self._x86_64_regions, "a.out")
5555

56-
@skipIfLLVMTargetMissing("X86")
57-
def test_x86_64_fd(self):
58-
"""Test that lldb can read the process information from an x86_64 linux core file."""
59-
self.do_test_fd("linux-x86_64", self._x86_64_pid, self._x86_64_regions, "a.out")
60-
6156
@skipIfLLVMTargetMissing("SystemZ")
6257
def test_s390x(self):
6358
"""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):
762757

763758
self.dbg.DeleteTarget(target)
764759

765-
def do_test_fd(self, filename, pid, region_count, thread_name):
766-
file_object = open(filename + ".core", "r")
767-
fd = file_object.fileno()
768-
file = lldb.SBFile(fd, "r", True)
769-
target = self.dbg.CreateTarget(filename + ".out")
770-
error = lldb.SBError()
771-
process = target.LoadCore(file, error)
772-
773-
self.check_all(process, pid, region_count, thread_name)
774-
775-
self.dbg.DeleteTarget(target)
776-
777-
778760

779761
def replace_path(binary, replace_from, replace_to):
780762
src = replace_from.encode()

0 commit comments

Comments
 (0)