Skip to content

Commit 6f41d70

Browse files
committed
Add check to EnsureValidConfiguration to filter out some corner cases
1 parent ef04502 commit 6f41d70

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

lldb/include/lldb/API/SBSaveCoreOptions.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ class LLDB_API SBSaveCoreOptions {
120120
SBThreadCollection GetThreadsToSave() const;
121121

122122
/// Get the current total number of bytes the core is expected to be but not
123-
/// including the overhead of the core file format. Requires a Process and
123+
/// including the overhead of the core file format. Requires a Process and
124124
/// Style to be specified.
125-
///
125+
///
126126
/// \note
127-
/// This can cause some modification of the underlying data store
127+
/// This can cause some modification of the underlying data store
128128
/// as regions with no permissions, or invalid permissions will be removed
129129
/// and stacks will be minified up to their stack pointer + the redzone.
130130
///

lldb/source/Symbol/SaveCoreOptions.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,17 @@ uint64_t SaveCoreOptions::GetCurrentSizeInBytes(Status &error) {
151151
return 0;
152152
}
153153

154+
error = EnsureValidConfiguration(m_process_sp);
155+
if (error.Fail())
156+
return 0;
157+
154158
CoreFileMemoryRanges ranges;
155159
error = m_process_sp->CalculateCoreFileSaveRanges(*this, ranges);
156160
if (error.Fail())
157161
return 0;
158162

159163
uint64_t total_in_bytes = 0;
160-
for (auto& core_range : ranges)
164+
for (auto &core_range : ranges)
161165
total_in_bytes += core_range.data.range.size();
162166

163167
return total_in_bytes;

0 commit comments

Comments
 (0)