CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
125 lines
3.7 KiB
C++
125 lines
3.7 KiB
C++
//===-- ProcessMinidump.h ---------------------------------------*- C++ -*-===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLDB_SOURCE_PLUGINS_PROCESS_MINIDUMP_PROCESSMINIDUMP_H
|
|
#define LLDB_SOURCE_PLUGINS_PROCESS_MINIDUMP_PROCESSMINIDUMP_H
|
|
|
|
#include "MinidumpParser.h"
|
|
#include "MinidumpTypes.h"
|
|
|
|
#include "lldb/Target/PostMortemProcess.h"
|
|
#include "lldb/Target/StopInfo.h"
|
|
#include "lldb/Target/Target.h"
|
|
#include "lldb/Utility/ConstString.h"
|
|
#include "lldb/Utility/Status.h"
|
|
|
|
#include "llvm/Support/Format.h"
|
|
#include "llvm/Support/raw_ostream.h"
|
|
#include <optional>
|
|
|
|
namespace lldb_private {
|
|
|
|
namespace minidump {
|
|
|
|
class ProcessMinidump : public PostMortemProcess {
|
|
public:
|
|
static lldb::ProcessSP CreateInstance(lldb::TargetSP target_sp,
|
|
lldb::ListenerSP listener_sp,
|
|
const FileSpec *crash_file_path,
|
|
bool can_connect);
|
|
|
|
static void Initialize();
|
|
|
|
static void Terminate();
|
|
|
|
static llvm::StringRef GetPluginNameStatic() { return "minidump"; }
|
|
|
|
static llvm::StringRef GetPluginDescriptionStatic();
|
|
|
|
ProcessMinidump(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp,
|
|
const FileSpec &core_file, lldb::DataBufferSP code_data);
|
|
|
|
~ProcessMinidump() override;
|
|
|
|
bool CanDebug(lldb::TargetSP target_sp,
|
|
bool plugin_specified_by_name) override;
|
|
|
|
CommandObject *GetPluginCommandObject() override;
|
|
|
|
Status DoLoadCore() override;
|
|
|
|
DynamicLoader *GetDynamicLoader() override;
|
|
|
|
// Returns AUXV structure found in the core file
|
|
lldb_private::DataExtractor GetAuxvData() override;
|
|
|
|
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
|
|
|
Status DoDestroy() override;
|
|
|
|
void RefreshStateAfterStop() override;
|
|
|
|
bool IsAlive() override;
|
|
|
|
bool WarnBeforeDetach() const override;
|
|
|
|
size_t ReadMemory(lldb::addr_t addr, void *buf, size_t size,
|
|
Status &error) override;
|
|
|
|
size_t DoReadMemory(lldb::addr_t addr, void *buf, size_t size,
|
|
Status &error) override;
|
|
|
|
ArchSpec GetArchitecture();
|
|
|
|
Status
|
|
GetMemoryRegions(lldb_private::MemoryRegionInfos ®ion_list) override;
|
|
|
|
bool GetProcessInfo(ProcessInstanceInfo &info) override;
|
|
|
|
Status WillResume() override {
|
|
return Status::FromErrorStringWithFormatv(
|
|
"error: {0} does not support resuming processes", GetPluginName());
|
|
}
|
|
|
|
std::optional<MinidumpParser> m_minidump_parser;
|
|
|
|
protected:
|
|
void Clear();
|
|
|
|
bool DoUpdateThreadList(ThreadList &old_thread_list,
|
|
ThreadList &new_thread_list) override;
|
|
|
|
Status DoGetMemoryRegionInfo(lldb::addr_t load_addr,
|
|
MemoryRegionInfo &range_info) override;
|
|
|
|
void ReadModuleList();
|
|
|
|
lldb::ModuleSP GetOrCreateModule(lldb_private::UUID minidump_uuid,
|
|
llvm::StringRef name,
|
|
lldb_private::ModuleSpec module_spec);
|
|
|
|
JITLoaderList &GetJITLoaders() override;
|
|
|
|
private:
|
|
lldb::DataBufferSP m_core_data;
|
|
llvm::ArrayRef<minidump::Thread> m_thread_list;
|
|
std::unordered_map<uint32_t, const minidump::ExceptionStream>
|
|
m_exceptions_by_tid;
|
|
lldb::CommandObjectSP m_command_sp;
|
|
bool m_is_wow64;
|
|
std::optional<MemoryRegionInfos> m_memory_regions;
|
|
|
|
void BuildMemoryRegions();
|
|
bool IsLLDBMinidump();
|
|
};
|
|
|
|
} // namespace minidump
|
|
} // namespace lldb_private
|
|
|
|
#endif // LLDB_SOURCE_PLUGINS_PROCESS_MINIDUMP_PROCESSMINIDUMP_H
|