aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp')
-rw-r--r--lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index 4322bd7..ce095bc 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -6347,24 +6347,22 @@ struct segment_vmaddr {
// are some multiple passes over the image list while calculating
// everything.
-static offset_t
-CreateAllImageInfosPayload(const lldb::ProcessSP &process_sp,
- offset_t initial_file_offset,
- StreamString &all_image_infos_payload,
- const lldb_private::SaveCoreOptions &options) {
+static offset_t CreateAllImageInfosPayload(
+ const lldb::ProcessSP &process_sp, offset_t initial_file_offset,
+ StreamString &all_image_infos_payload, SaveCoreStyle core_style) {
Target &target = process_sp->GetTarget();
ModuleList modules = target.GetImages();
// stack-only corefiles have no reason to include binaries that
// are not executing; we're trying to make the smallest corefile
// we can, so leave the rest out.
- if (options.GetStyle() == SaveCoreStyle::eSaveCoreStackOnly)
+ if (core_style == SaveCoreStyle::eSaveCoreStackOnly)
modules.Clear();
std::set<std::string> executing_uuids;
- std::vector<ThreadSP> thread_list =
- process_sp->CalculateCoreFileThreadList(options);
- for (const ThreadSP &thread_sp : thread_list) {
+ ThreadList &thread_list(process_sp->GetThreadList());
+ for (uint32_t i = 0; i < thread_list.GetSize(); i++) {
+ ThreadSP thread_sp = thread_list.GetThreadAtIndex(i);
uint32_t stack_frame_count = thread_sp->GetStackFrameCount();
for (uint32_t j = 0; j < stack_frame_count; j++) {
StackFrameSP stack_frame_sp = thread_sp->GetStackFrameAtIndex(j);
@@ -6561,7 +6559,7 @@ bool ObjectFileMachO::SaveCore(const lldb::ProcessSP &process_sp,
if (make_core) {
Process::CoreFileMemoryRanges core_ranges;
- error = process_sp->CalculateCoreFileSaveRanges(options, core_ranges);
+ error = process_sp->CalculateCoreFileSaveRanges(core_style, core_ranges);
if (error.Success()) {
const uint32_t addr_byte_size = target_arch.GetAddressByteSize();
const ByteOrder byte_order = target_arch.GetByteOrder();
@@ -6732,8 +6730,8 @@ bool ObjectFileMachO::SaveCore(const lldb::ProcessSP &process_sp,
std::make_shared<StructuredData::Dictionary>());
StructuredData::ArraySP threads(
std::make_shared<StructuredData::Array>());
- for (const ThreadSP &thread_sp :
- process_sp->CalculateCoreFileThreadList(options)) {
+ for (uint32_t thread_idx = 0; thread_idx < num_threads; ++thread_idx) {
+ ThreadSP thread_sp(thread_list.GetThreadAtIndex(thread_idx));
StructuredData::DictionarySP thread(
std::make_shared<StructuredData::Dictionary>());
thread->AddIntegerItem("thread_id", thread_sp->GetID());
@@ -6756,7 +6754,7 @@ bool ObjectFileMachO::SaveCore(const lldb::ProcessSP &process_sp,
all_image_infos_lcnote_up->payload_file_offset = file_offset;
file_offset = CreateAllImageInfosPayload(
process_sp, file_offset, all_image_infos_lcnote_up->payload,
- options);
+ core_style);
lc_notes.push_back(std::move(all_image_infos_lcnote_up));
// Add LC_NOTE load commands