LLDB mainline
Classes | Functions
MinidumpFileBuilder.cpp File Reference
#include "MinidumpFileBuilder.h"
#include "Plugins/Process/minidump/RegisterContextMinidump_ARM64.h"
#include "Plugins/Process/minidump/RegisterContextMinidump_x86_64.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/ModuleList.h"
#include "lldb/Core/Section.h"
#include "lldb/Target/ABI.h"
#include "lldb/Target/MemoryRegionInfo.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Target/StopInfo.h"
#include "lldb/Target/ThreadList.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/RangeMap.h"
#include "lldb/Utility/RegisterValue.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/Minidump.h"
#include "llvm/Support/ConvertUTF.h"
#include "llvm/Support/Endian.h"
#include "llvm/Support/Error.h"
#include "llvm/TargetParser/Triple.h"
#include "Plugins/Process/minidump/MinidumpTypes.h"
#include "lldb/lldb-enumerations.h"
#include "lldb/lldb-forward.h"
#include "lldb/lldb-types.h"
#include <algorithm>
#include <cinttypes>
#include <climits>
#include <cstddef>
#include <cstdint>
#include <functional>
#include <iostream>
#include <set>
#include <utility>
#include <vector>

Go to the source code of this file.

Classes

class  ArchThreadContexts
 

Functions

Status WriteString (const std::string &to_write, lldb_private::DataBufferHeap *buffer)
 
llvm::Expected< uint64_t > getModuleFileSize (Target &target, const ModuleSP &mod)
 
uint16_t read_register_u16_raw (RegisterContext *reg_ctx, llvm::StringRef reg_name)
 
uint32_t read_register_u32_raw (RegisterContext *reg_ctx, llvm::StringRef reg_name)
 
uint64_t read_register_u64_raw (RegisterContext *reg_ctx, llvm::StringRef reg_name)
 
llvm::support::ulittle16_t read_register_u16 (RegisterContext *reg_ctx, llvm::StringRef reg_name)
 
llvm::support::ulittle32_t read_register_u32 (RegisterContext *reg_ctx, llvm::StringRef reg_name)
 
llvm::support::ulittle64_t read_register_u64 (RegisterContext *reg_ctx, llvm::StringRef reg_name)
 
void read_register_u128 (RegisterContext *reg_ctx, llvm::StringRef reg_name, uint8_t *dst)
 
lldb_private::minidump::MinidumpContext_x86_64 GetThreadContext_x86_64 (RegisterContext *reg_ctx)
 
minidump::RegisterContextMinidump_ARM64::Context GetThreadContext_ARM64 (RegisterContext *reg_ctx)
 
std::unique_ptr< llvm::MemoryBuffer > getFileStreamHelper (const std::string &path)
 
static uint64_t GetLargestRangeSize (const Process::CoreFileMemoryRanges &ranges)
 

Function Documentation

◆ getFileStreamHelper()

std::unique_ptr< llvm::MemoryBuffer > getFileStreamHelper ( const std::string &  path)

Definition at line 760 of file MinidumpFileBuilder.cpp.

Referenced by MinidumpFileBuilder::AddLinuxFileStreams().

◆ GetLargestRangeSize()

static uint64_t GetLargestRangeSize ( const Process::CoreFileMemoryRanges ranges)
static

◆ getModuleFileSize()

llvm::Expected< uint64_t > getModuleFileSize ( Target target,
const ModuleSP mod 
)

◆ GetThreadContext_ARM64()

◆ GetThreadContext_x86_64()

lldb_private::minidump::MinidumpContext_x86_64 GetThreadContext_x86_64 ( RegisterContext reg_ctx)

Definition at line 466 of file MinidumpFileBuilder.cpp.

References lldb_private::minidump::MinidumpContext_x86_64::context_flags, lldb_private::minidump::Control, lldb_private::minidump::MinidumpContext_x86_64::cs, lldb_private::minidump::MinidumpContext_x86_64::ds, lldb_private::minidump::MinidumpContext_x86_64::eflags, lldb_private::minidump::MinidumpContext_x86_64::fs, lldb_private::minidump::MinidumpContext_x86_64::gs, lldb_private::minidump::Integer, lldb_private::minidump::MinidumpContext_x86_64::p1_home, lldb_private::minidump::MinidumpContext_x86_64::r10, lldb_private::minidump::MinidumpContext_x86_64::r11, lldb_private::minidump::MinidumpContext_x86_64::r12, lldb_private::minidump::MinidumpContext_x86_64::r13, lldb_private::minidump::MinidumpContext_x86_64::r14, lldb_private::minidump::MinidumpContext_x86_64::r15, lldb_private::minidump::MinidumpContext_x86_64::r8, lldb_private::minidump::MinidumpContext_x86_64::r9, lldb_private::minidump::MinidumpContext_x86_64::rax, lldb_private::minidump::MinidumpContext_x86_64::rbp, lldb_private::minidump::MinidumpContext_x86_64::rbx, lldb_private::minidump::MinidumpContext_x86_64::rcx, lldb_private::minidump::MinidumpContext_x86_64::rdi, lldb_private::minidump::MinidumpContext_x86_64::rdx, read_register_u16(), read_register_u32(), read_register_u64(), lldb_private::minidump::MinidumpContext_x86_64::rip, lldb_private::minidump::MinidumpContext_x86_64::rsi, lldb_private::minidump::MinidumpContext_x86_64::rsp, lldb_private::minidump::Segments, lldb_private::minidump::MinidumpContext_x86_64::ss, and lldb_private::minidump::x86_64_Flag.

Referenced by ArchThreadContexts::prepareRegisterContext().

◆ read_register_u128()

void read_register_u128 ( RegisterContext reg_ctx,
llvm::StringRef  reg_name,
uint8_t *  dst 
)

◆ read_register_u16()

llvm::support::ulittle16_t read_register_u16 ( RegisterContext reg_ctx,
llvm::StringRef  reg_name 
)

Definition at line 430 of file MinidumpFileBuilder.cpp.

References read_register_u16_raw().

Referenced by GetThreadContext_x86_64().

◆ read_register_u16_raw()

uint16_t read_register_u16_raw ( RegisterContext reg_ctx,
llvm::StringRef  reg_name 
)

◆ read_register_u32()

llvm::support::ulittle32_t read_register_u32 ( RegisterContext reg_ctx,
llvm::StringRef  reg_name 
)

Definition at line 436 of file MinidumpFileBuilder.cpp.

References read_register_u32_raw().

Referenced by GetThreadContext_ARM64(), and GetThreadContext_x86_64().

◆ read_register_u32_raw()

uint32_t read_register_u32_raw ( RegisterContext reg_ctx,
llvm::StringRef  reg_name 
)

◆ read_register_u64()

llvm::support::ulittle64_t read_register_u64 ( RegisterContext reg_ctx,
llvm::StringRef  reg_name 
)

Definition at line 442 of file MinidumpFileBuilder.cpp.

References read_register_u64_raw().

Referenced by GetThreadContext_ARM64(), and GetThreadContext_x86_64().

◆ read_register_u64_raw()

uint64_t read_register_u64_raw ( RegisterContext reg_ctx,
llvm::StringRef  reg_name 
)

◆ WriteString()

Status WriteString ( const std::string &  to_write,
lldb_private::DataBufferHeap buffer 
)