003 File Manager
Current Path:
/usr/src/contrib/llvm-project/lldb/source/Plugins/Process/Utility
usr
/
src
/
contrib
/
llvm-project
/
lldb
/
source
/
Plugins
/
Process
/
Utility
/
📁
..
📄
ARMDefines.h
(6.17 KB)
📄
ARMUtils.h
(10.38 KB)
📄
AuxVector.cpp
(3.61 KB)
📄
AuxVector.h
(3 KB)
📄
DynamicRegisterInfo.cpp
(29.35 KB)
📄
DynamicRegisterInfo.h
(3.3 KB)
📄
FreeBSDSignals.cpp
(5.48 KB)
📄
FreeBSDSignals.h
(802 B)
📄
GDBRemoteSignals.cpp
(648 B)
📄
GDBRemoteSignals.h
(893 B)
📄
HistoryThread.cpp
(2.79 KB)
📄
HistoryThread.h
(2.87 KB)
📄
HistoryUnwind.cpp
(2.27 KB)
📄
HistoryUnwind.h
(1.42 KB)
📄
InferiorCallPOSIX.cpp
(6.44 KB)
📄
InferiorCallPOSIX.h
(1.09 KB)
📄
InstructionUtils.h
(4.01 KB)
📄
LinuxProcMaps.cpp
(4.35 KB)
📄
LinuxProcMaps.h
(954 B)
📄
LinuxSignals.cpp
(5.43 KB)
📄
LinuxSignals.h
(790 B)
📄
MipsLinuxSignals.cpp
(5.46 KB)
📄
MipsLinuxSignals.h
(816 B)
📄
NativeRegisterContextRegisterInfo.cpp
(1.48 KB)
📄
NativeRegisterContextRegisterInfo.h
(1.31 KB)
📄
NetBSDSignals.cpp
(3.09 KB)
📄
NetBSDSignals.h
(795 B)
📄
RegisterContextDarwinConstants.h
(852 B)
📄
RegisterContextDarwin_arm.cpp
(41.55 KB)
📄
RegisterContextDarwin_arm.h
(6.99 KB)
📄
RegisterContextDarwin_arm64.cpp
(27.29 KB)
📄
RegisterContextDarwin_arm64.h
(6.31 KB)
📄
RegisterContextDarwin_i386.cpp
(23.66 KB)
📄
RegisterContextDarwin_i386.h
(5.08 KB)
📄
RegisterContextDarwin_x86_64.cpp
(26.65 KB)
📄
RegisterContextDarwin_x86_64.h
(5.28 KB)
📄
RegisterContextDummy.cpp
(3.78 KB)
📄
RegisterContextDummy.h
(2.16 KB)
📄
RegisterContextFreeBSD_i386.cpp
(2.15 KB)
📄
RegisterContextFreeBSD_i386.h
(886 B)
📄
RegisterContextFreeBSD_mips64.cpp
(3.43 KB)
📄
RegisterContextFreeBSD_mips64.h
(1007 B)
📄
RegisterContextFreeBSD_powerpc.cpp
(5.29 KB)
📄
RegisterContextFreeBSD_powerpc.h
(1.74 KB)
📄
RegisterContextFreeBSD_x86_64.cpp
(4.27 KB)
📄
RegisterContextFreeBSD_x86_64.h
(998 B)
📄
RegisterContextHistory.cpp
(3.9 KB)
📄
RegisterContextHistory.h
(2.23 KB)
📄
RegisterContextLinux_i386.cpp
(4.5 KB)
📄
RegisterContextLinux_i386.h
(1.07 KB)
📄
RegisterContextLinux_mips.cpp
(5.82 KB)
📄
RegisterContextLinux_mips.h
(1.14 KB)
📄
RegisterContextLinux_mips64.cpp
(7.67 KB)
📄
RegisterContextLinux_mips64.h
(1.24 KB)
📄
RegisterContextLinux_s390x.cpp
(2.33 KB)
📄
RegisterContextLinux_s390x.h
(1.19 KB)
📄
RegisterContextLinux_x86_64.cpp
(6.19 KB)
📄
RegisterContextLinux_x86_64.h
(1.2 KB)
📄
RegisterContextMach_arm.cpp
(2.59 KB)
📄
RegisterContextMach_arm.h
(1.32 KB)
📄
RegisterContextMach_i386.cpp
(2.13 KB)
📄
RegisterContextMach_i386.h
(1.21 KB)
📄
RegisterContextMach_x86_64.cpp
(2.24 KB)
📄
RegisterContextMach_x86_64.h
(1.24 KB)
📄
RegisterContextMemory.cpp
(4.75 KB)
📄
RegisterContextMemory.h
(2.71 KB)
📄
RegisterContextNetBSD_i386.cpp
(2.87 KB)
📄
RegisterContextNetBSD_i386.h
(882 B)
📄
RegisterContextNetBSD_x86_64.cpp
(5.49 KB)
📄
RegisterContextNetBSD_x86_64.h
(1.06 KB)
📄
RegisterContextOpenBSD_i386.cpp
(2.07 KB)
📄
RegisterContextOpenBSD_i386.h
(886 B)
📄
RegisterContextOpenBSD_x86_64.cpp
(2.78 KB)
📄
RegisterContextOpenBSD_x86_64.h
(998 B)
📄
RegisterContextPOSIX_arm.cpp
(6.62 KB)
📄
RegisterContextPOSIX_arm.h
(2.87 KB)
📄
RegisterContextPOSIX_arm64.cpp
(3.03 KB)
📄
RegisterContextPOSIX_arm64.h
(2.3 KB)
📄
RegisterContextPOSIX_mips64.cpp
(5.75 KB)
📄
RegisterContextPOSIX_mips64.h
(2.41 KB)
📄
RegisterContextPOSIX_powerpc.cpp
(5.91 KB)
📄
RegisterContextPOSIX_powerpc.h
(4.75 KB)
📄
RegisterContextPOSIX_ppc64le.cpp
(7.28 KB)
📄
RegisterContextPOSIX_ppc64le.h
(2.27 KB)
📄
RegisterContextPOSIX_s390x.cpp
(5.67 KB)
📄
RegisterContextPOSIX_s390x.h
(2.08 KB)
📄
RegisterContextPOSIX_x86.cpp
(22.13 KB)
📄
RegisterContextPOSIX_x86.h
(5.31 KB)
📄
RegisterContextThreadMemory.cpp
(6.75 KB)
📄
RegisterContextThreadMemory.h
(3.71 KB)
📄
RegisterContextWindows_i386.cpp
(4.35 KB)
📄
RegisterContextWindows_i386.h
(937 B)
📄
RegisterContextWindows_x86_64.cpp
(6.78 KB)
📄
RegisterContextWindows_x86_64.h
(949 B)
📄
RegisterContext_mips.h
(6.85 KB)
📄
RegisterContext_powerpc.h
(2.82 KB)
📄
RegisterContext_s390x.h
(2.04 KB)
📄
RegisterContext_x86.h
(9.61 KB)
📄
RegisterInfoAndSetInterface.h
(1.14 KB)
📄
RegisterInfoInterface.h
(2.28 KB)
📄
RegisterInfoPOSIX_arm.cpp
(3.51 KB)
📄
RegisterInfoPOSIX_arm.h
(1.58 KB)
📄
RegisterInfoPOSIX_arm64.cpp
(7.83 KB)
📄
RegisterInfoPOSIX_arm64.h
(2.27 KB)
📄
RegisterInfoPOSIX_ppc64le.cpp
(1.95 KB)
📄
RegisterInfoPOSIX_ppc64le.h
(1.02 KB)
📄
RegisterInfos_arm.h
(37.11 KB)
📄
RegisterInfos_arm64.h
(28.46 KB)
📄
RegisterInfos_i386.h
(15.93 KB)
📄
RegisterInfos_mips.h
(16.18 KB)
📄
RegisterInfos_mips64.h
(23.21 KB)
📄
RegisterInfos_powerpc.h
(14.8 KB)
📄
RegisterInfos_ppc64.h
(16.62 KB)
📄
RegisterInfos_ppc64le.h
(23.77 KB)
📄
RegisterInfos_s390x.h
(6.47 KB)
📄
RegisterInfos_x86_64.h
(24.31 KB)
📄
StopInfoMachException.cpp
(16.87 KB)
📄
StopInfoMachException.h
(1.78 KB)
📄
ThreadMemory.cpp
(3.04 KB)
📄
ThreadMemory.h
(3.22 KB)
📄
lldb-arm-register-enums.h
(3.56 KB)
📄
lldb-arm64-register-enums.h
(4.87 KB)
📄
lldb-mips-freebsd-register-enums.h
(1.62 KB)
📄
lldb-mips-linux-register-enums.h
(7.25 KB)
📄
lldb-ppc64-register-enums.h
(2.91 KB)
📄
lldb-ppc64le-register-enums.h
(4.63 KB)
📄
lldb-s390x-register-enums.h
(2.31 KB)
📄
lldb-x86-register-enums.h
(7.93 KB)
Editing: RegisterContextThreadMemory.cpp
//===-- RegisterContextThreadMemory.cpp -----------------------------------===// // // 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 // //===----------------------------------------------------------------------===// #include "lldb/Target/OperatingSystem.h" #include "lldb/Target/Process.h" #include "lldb/Target/Thread.h" #include "lldb/Utility/Status.h" #include "lldb/lldb-private.h" #include "RegisterContextThreadMemory.h" using namespace lldb; using namespace lldb_private; RegisterContextThreadMemory::RegisterContextThreadMemory( Thread &thread, lldb::addr_t register_data_addr) : RegisterContext(thread, 0), m_thread_wp(thread.shared_from_this()), m_reg_ctx_sp(), m_register_data_addr(register_data_addr), m_stop_id(0) {} RegisterContextThreadMemory::~RegisterContextThreadMemory() {} void RegisterContextThreadMemory::UpdateRegisterContext() { ThreadSP thread_sp(m_thread_wp.lock()); if (thread_sp) { ProcessSP process_sp(thread_sp->GetProcess()); if (process_sp) { const uint32_t stop_id = process_sp->GetModID().GetStopID(); if (m_stop_id != stop_id) { m_stop_id = stop_id; m_reg_ctx_sp.reset(); } if (!m_reg_ctx_sp) { ThreadSP backing_thread_sp(thread_sp->GetBackingThread()); if (backing_thread_sp) { m_reg_ctx_sp = backing_thread_sp->GetRegisterContext(); } else { OperatingSystem *os = process_sp->GetOperatingSystem(); if (os->IsOperatingSystemPluginThread(thread_sp)) m_reg_ctx_sp = os->CreateRegisterContextForThread( thread_sp.get(), m_register_data_addr); } } } else { m_reg_ctx_sp.reset(); } } else { m_reg_ctx_sp.reset(); } } // Subclasses must override these functions void RegisterContextThreadMemory::InvalidateAllRegisters() { UpdateRegisterContext(); if (m_reg_ctx_sp) m_reg_ctx_sp->InvalidateAllRegisters(); } size_t RegisterContextThreadMemory::GetRegisterCount() { UpdateRegisterContext(); if (m_reg_ctx_sp) return m_reg_ctx_sp->GetRegisterCount(); return 0; } const RegisterInfo * RegisterContextThreadMemory::GetRegisterInfoAtIndex(size_t reg) { UpdateRegisterContext(); if (m_reg_ctx_sp) return m_reg_ctx_sp->GetRegisterInfoAtIndex(reg); return nullptr; } size_t RegisterContextThreadMemory::GetRegisterSetCount() { UpdateRegisterContext(); if (m_reg_ctx_sp) return m_reg_ctx_sp->GetRegisterSetCount(); return 0; } const RegisterSet *RegisterContextThreadMemory::GetRegisterSet(size_t reg_set) { UpdateRegisterContext(); if (m_reg_ctx_sp) return m_reg_ctx_sp->GetRegisterSet(reg_set); return nullptr; } bool RegisterContextThreadMemory::ReadRegister(const RegisterInfo *reg_info, RegisterValue ®_value) { UpdateRegisterContext(); if (m_reg_ctx_sp) return m_reg_ctx_sp->ReadRegister(reg_info, reg_value); return false; } bool RegisterContextThreadMemory::WriteRegister( const RegisterInfo *reg_info, const RegisterValue ®_value) { UpdateRegisterContext(); if (m_reg_ctx_sp) return m_reg_ctx_sp->WriteRegister(reg_info, reg_value); return false; } bool RegisterContextThreadMemory::ReadAllRegisterValues( lldb::DataBufferSP &data_sp) { UpdateRegisterContext(); if (m_reg_ctx_sp) return m_reg_ctx_sp->ReadAllRegisterValues(data_sp); return false; } bool RegisterContextThreadMemory::WriteAllRegisterValues( const lldb::DataBufferSP &data_sp) { UpdateRegisterContext(); if (m_reg_ctx_sp) return m_reg_ctx_sp->WriteAllRegisterValues(data_sp); return false; } bool RegisterContextThreadMemory::CopyFromRegisterContext( lldb::RegisterContextSP reg_ctx_sp) { UpdateRegisterContext(); if (m_reg_ctx_sp) return m_reg_ctx_sp->CopyFromRegisterContext(reg_ctx_sp); return false; } uint32_t RegisterContextThreadMemory::ConvertRegisterKindToRegisterNumber( lldb::RegisterKind kind, uint32_t num) { UpdateRegisterContext(); if (m_reg_ctx_sp) return m_reg_ctx_sp->ConvertRegisterKindToRegisterNumber(kind, num); return false; } uint32_t RegisterContextThreadMemory::NumSupportedHardwareBreakpoints() { UpdateRegisterContext(); if (m_reg_ctx_sp) return m_reg_ctx_sp->NumSupportedHardwareBreakpoints(); return false; } uint32_t RegisterContextThreadMemory::SetHardwareBreakpoint(lldb::addr_t addr, size_t size) { UpdateRegisterContext(); if (m_reg_ctx_sp) return m_reg_ctx_sp->SetHardwareBreakpoint(addr, size); return 0; } bool RegisterContextThreadMemory::ClearHardwareBreakpoint(uint32_t hw_idx) { UpdateRegisterContext(); if (m_reg_ctx_sp) return m_reg_ctx_sp->ClearHardwareBreakpoint(hw_idx); return false; } uint32_t RegisterContextThreadMemory::NumSupportedHardwareWatchpoints() { UpdateRegisterContext(); if (m_reg_ctx_sp) return m_reg_ctx_sp->NumSupportedHardwareWatchpoints(); return 0; } uint32_t RegisterContextThreadMemory::SetHardwareWatchpoint(lldb::addr_t addr, size_t size, bool read, bool write) { UpdateRegisterContext(); if (m_reg_ctx_sp) return m_reg_ctx_sp->SetHardwareWatchpoint(addr, size, read, write); return 0; } bool RegisterContextThreadMemory::ClearHardwareWatchpoint(uint32_t hw_index) { UpdateRegisterContext(); if (m_reg_ctx_sp) return m_reg_ctx_sp->ClearHardwareWatchpoint(hw_index); return false; } bool RegisterContextThreadMemory::HardwareSingleStep(bool enable) { UpdateRegisterContext(); if (m_reg_ctx_sp) return m_reg_ctx_sp->HardwareSingleStep(enable); return false; } Status RegisterContextThreadMemory::ReadRegisterValueFromMemory( const lldb_private::RegisterInfo *reg_info, lldb::addr_t src_addr, uint32_t src_len, RegisterValue ®_value) { UpdateRegisterContext(); if (m_reg_ctx_sp) return m_reg_ctx_sp->ReadRegisterValueFromMemory(reg_info, src_addr, src_len, reg_value); Status error; error.SetErrorString("invalid register context"); return error; } Status RegisterContextThreadMemory::WriteRegisterValueToMemory( const lldb_private::RegisterInfo *reg_info, lldb::addr_t dst_addr, uint32_t dst_len, const RegisterValue ®_value) { UpdateRegisterContext(); if (m_reg_ctx_sp) return m_reg_ctx_sp->WriteRegisterValueToMemory(reg_info, dst_addr, dst_len, reg_value); Status error; error.SetErrorString("invalid register context"); return error; }
Upload File
Create Folder