Skip to content

Commit b959532

Browse files
authored
Revert "[LLDB][SBSaveCore] Add selectable memory regions to SBSaveCor… (#106293)
Reverts #105442. Due to `TestSkinnyCoreFailing` and root causing of the failure will likely take longer than EOD.
1 parent 751e681 commit b959532

20 files changed

+33
-305
lines changed

lldb/include/lldb/API/SBMemoryRegionInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class LLDB_API SBMemoryRegionInfo {
120120
private:
121121
friend class SBProcess;
122122
friend class SBMemoryRegionInfoList;
123-
friend class SBSaveCoreOptions;
123+
124124
friend class lldb_private::ScriptInterpreter;
125125

126126
lldb_private::MemoryRegionInfo &ref();

lldb/include/lldb/API/SBSaveCoreOptions.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,6 @@ class LLDB_API SBSaveCoreOptions {
8080
/// \return True if the thread was removed, false if it was not in the list.
8181
bool RemoveThread(lldb::SBThread thread);
8282

83-
/// Add a memory region to save in the core file.
84-
///
85-
/// \param region The memory region to save.
86-
/// \returns An empty SBError upon success, or an error if the region is
87-
/// invalid.
88-
/// \note Ranges that overlapped will be unioned into a single region, this
89-
/// also supercedes stack minification. Specifying full regions and a
90-
/// non-custom core style will include the specified regions and union them
91-
/// with all style specific regions.
92-
SBError AddMemoryRegionToSave(const SBMemoryRegionInfo &region);
93-
9483
/// Reset all options.
9584
void Clear();
9685

lldb/include/lldb/Symbol/SaveCoreOptions.h

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@
1010
#define LLDB_SOURCE_PLUGINS_OBJECTFILE_SaveCoreOPTIONS_H
1111

1212
#include "lldb/Utility/FileSpec.h"
13-
#include "lldb/Utility/RangeMap.h"
13+
#include "lldb/lldb-forward.h"
14+
#include "lldb/lldb-types.h"
1415

1516
#include <optional>
16-
#include <set>
1717
#include <string>
1818
#include <unordered_set>
1919

20-
using MemoryRanges = lldb_private::RangeVector<lldb::addr_t, lldb::addr_t>;
21-
2220
namespace lldb_private {
2321

2422
class SaveCoreOptions {
@@ -40,12 +38,8 @@ class SaveCoreOptions {
4038
Status AddThread(lldb::ThreadSP thread_sp);
4139
bool RemoveThread(lldb::ThreadSP thread_sp);
4240
bool ShouldThreadBeSaved(lldb::tid_t tid) const;
43-
bool HasSpecifiedThreads() const;
4441

4542
Status EnsureValidConfiguration(lldb::ProcessSP process_sp) const;
46-
const MemoryRanges &GetCoreFileMemoryRanges() const;
47-
48-
void AddMemoryRegionToSave(const lldb_private::MemoryRegionInfo &region);
4943

5044
void Clear();
5145

@@ -57,7 +51,6 @@ class SaveCoreOptions {
5751
std::optional<lldb::SaveCoreStyle> m_style;
5852
lldb::ProcessSP m_process_sp;
5953
std::unordered_set<lldb::tid_t> m_threads_to_save;
60-
MemoryRanges m_regions_to_save;
6154
};
6255
} // namespace lldb_private
6356

lldb/include/lldb/Target/Process.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
#include "lldb/Host/ProcessLaunchInfo.h"
3636
#include "lldb/Host/ProcessRunLock.h"
3737
#include "lldb/Symbol/ObjectFile.h"
38-
#include "lldb/Symbol/SaveCoreOptions.h"
3938
#include "lldb/Target/ExecutionContextScope.h"
4039
#include "lldb/Target/InstrumentationRuntime.h"
4140
#include "lldb/Target/Memory.h"
@@ -732,9 +731,7 @@ class Process : public std::enable_shared_from_this<Process>,
732731
}
733732
};
734733

735-
using CoreFileMemoryRanges =
736-
lldb_private::RangeDataVector<lldb::addr_t, lldb::addr_t,
737-
CoreFileMemoryRange>;
734+
using CoreFileMemoryRanges = std::vector<CoreFileMemoryRange>;
738735

739736
/// Helper function for Process::SaveCore(...) that calculates the address
740737
/// ranges that should be saved. This allows all core file plug-ins to save

lldb/include/lldb/Utility/RangeMap.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,8 +450,6 @@ class RangeDataVector {
450450

451451
void Append(const Entry &entry) { m_entries.emplace_back(entry); }
452452

453-
void Append(B &&b, S &&s, T &&t) { m_entries.emplace_back(Entry(b, s, t)); }
454-
455453
bool Erase(uint32_t start, uint32_t end) {
456454
if (start >= end || end > m_entries.size())
457455
return false;

lldb/include/lldb/lldb-enumerations.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1222,7 +1222,6 @@ enum SaveCoreStyle {
12221222
eSaveCoreFull = 1,
12231223
eSaveCoreDirtyOnly = 2,
12241224
eSaveCoreStackOnly = 3,
1225-
eSaveCoreCustomOnly = 4,
12261225
};
12271226

12281227
/// Events that might happen during a trace session.

lldb/include/lldb/lldb-forward.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ class StackFrameRecognizer;
207207
class StackFrameRecognizerManager;
208208
class StackID;
209209
class Status;
210-
class SaveCoreOptions;
211210
class StopInfo;
212211
class Stoppoint;
213212
class StoppointCallbackContext;

lldb/include/lldb/lldb-private-interfaces.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#ifndef LLDB_LLDB_PRIVATE_INTERFACES_H
1010
#define LLDB_LLDB_PRIVATE_INTERFACES_H
1111

12+
#include "lldb/Symbol/SaveCoreOptions.h"
1213
#include "lldb/lldb-enumerations.h"
1314
#include "lldb/lldb-forward.h"
1415
#include "lldb/lldb-private-enumerations.h"

lldb/source/API/SBSaveCoreOptions.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "lldb/API/SBSaveCoreOptions.h"
10-
#include "lldb/API/SBMemoryRegionInfo.h"
1110
#include "lldb/Host/FileSystem.h"
1211
#include "lldb/Symbol/SaveCoreOptions.h"
1312
#include "lldb/Utility/Instrumentation.h"
@@ -91,16 +90,6 @@ bool SBSaveCoreOptions::RemoveThread(lldb::SBThread thread) {
9190
return m_opaque_up->RemoveThread(thread.GetSP());
9291
}
9392

94-
lldb::SBError
95-
SBSaveCoreOptions::AddMemoryRegionToSave(const SBMemoryRegionInfo &region) {
96-
LLDB_INSTRUMENT_VA(this, region);
97-
// Currently add memory region can't fail, so we always return a success
98-
// SBerror, but because these API's live forever, this is the most future
99-
// proof thing to do.
100-
m_opaque_up->AddMemoryRegionToSave(region.ref());
101-
return SBError();
102-
}
103-
10493
void SBSaveCoreOptions::Clear() {
10594
LLDB_INSTRUMENT_VA(this);
10695
m_opaque_up->Clear();

lldb/source/Commands/CommandObjectProcess.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include "lldb/Interpreter/OptionArgParser.h"
2626
#include "lldb/Interpreter/OptionGroupPythonClassWithDict.h"
2727
#include "lldb/Interpreter/Options.h"
28-
#include "lldb/Symbol/SaveCoreOptions.h"
2928
#include "lldb/Target/Platform.h"
3029
#include "lldb/Target/Process.h"
3130
#include "lldb/Target/StopInfo.h"

0 commit comments

Comments
 (0)