diff options
author | Jacob Lalonde <jalalonde@fb.com> | 2024-08-05 10:17:25 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-05 10:17:25 -0700 |
commit | accf5c9bb3b5fe88628a44062a5c0c2f903fca2c (patch) | |
tree | f2d30eaa9311ef7117662cf743c0b186c28c0a33 /lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp | |
parent | 0319711f89ed815b92ab581ed98cc4ace5178135 (diff) | |
download | llvm-accf5c9bb3b5fe88628a44062a5c0c2f903fca2c.zip llvm-accf5c9bb3b5fe88628a44062a5c0c2f903fca2c.tar.gz llvm-accf5c9bb3b5fe88628a44062a5c0c2f903fca2c.tar.bz2 |
Revert "[LLDB][SBSaveCore] Implement a selectable threadlist for Core… (#102018)
… Options. (#100443)"
This reverts commit 3e4af616334eae532f308605b89ff158dd195180.
@adrian-prantl FYI
Reverts #100443
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp | 24 |
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 |