|
LLDB mainline
|
#include <RegisterContextWasm.h>
Public Member Functions | |
| RegisterContextWasm (process_gdb_remote::ThreadGDBRemote &thread, uint32_t concrete_frame_idx, lldb::DynamicRegisterInfoSP reg_info_sp) | |
| ~RegisterContextWasm () override | |
| uint32_t | ConvertRegisterKindToRegisterNumber (lldb::RegisterKind kind, uint32_t num) override |
| Convert from a given register numbering scheme to the lldb register numbering scheme. | |
| void | InvalidateAllRegisters () override |
| size_t | GetRegisterCount () override |
| const RegisterInfo * | GetRegisterInfoAtIndex (size_t reg) override |
| size_t | GetRegisterSetCount () override |
| const RegisterSet * | GetRegisterSet (size_t reg_set) override |
| bool | ReadRegister (const RegisterInfo *reg_info, RegisterValue &value) override |
| bool | WriteRegister (const RegisterInfo *reg_info, const RegisterValue &value) override |
| Public Member Functions inherited from lldb_private::process_gdb_remote::GDBRemoteRegisterContext | |
| GDBRemoteRegisterContext (ThreadGDBRemote &thread, uint32_t concrete_frame_idx, lldb::DynamicRegisterInfoSP reg_info_sp, bool read_all_at_once, bool write_all_at_once) | |
| ~GDBRemoteRegisterContext () override | |
| bool | ReadAllRegisterValues (lldb::WritableDataBufferSP &data_sp) override |
| bool | WriteAllRegisterValues (const lldb::DataBufferSP &data_sp) override |
| bool | ReadAllRegisterValues (RegisterCheckpoint ®_checkpoint) override |
| bool | WriteAllRegisterValues (const RegisterCheckpoint ®_checkpoint) override |
| bool | RegisterWriteCausesReconfigure (const llvm::StringRef name) override |
| bool | ReconfigureRegisterInfo () override |
| Public Member Functions inherited from lldb_private::RegisterContext | |
| RegisterContext (Thread &thread, uint32_t concrete_frame_idx) | |
| ~RegisterContext () override | |
| void | InvalidateIfNeeded (bool force) |
| virtual lldb::ByteOrder | GetByteOrder () |
| bool | CopyFromRegisterContext (lldb::RegisterContextSP context) |
| virtual uint32_t | NumSupportedHardwareBreakpoints () |
| virtual uint32_t | SetHardwareBreakpoint (lldb::addr_t addr, size_t size) |
| virtual bool | ClearHardwareBreakpoint (uint32_t hw_idx) |
| virtual uint32_t | NumSupportedHardwareWatchpoints () |
| virtual uint32_t | SetHardwareWatchpoint (lldb::addr_t addr, size_t size, bool read, bool write) |
| virtual bool | ClearHardwareWatchpoint (uint32_t hw_index) |
| virtual bool | HardwareSingleStep (bool enable) |
| virtual Status | ReadRegisterValueFromMemory (const lldb_private::RegisterInfo *reg_info, lldb::addr_t src_addr, uint32_t src_len, RegisterValue ®_value) |
| virtual Status | WriteRegisterValueToMemory (const lldb_private::RegisterInfo *reg_info, lldb::addr_t dst_addr, uint32_t dst_len, const RegisterValue ®_value) |
| virtual lldb::tid_t | GetThreadID () const |
| virtual Thread & | GetThread () |
| const RegisterInfo * | GetRegisterInfoByName (llvm::StringRef reg_name, uint32_t start_idx=0) |
| const RegisterInfo * | GetRegisterInfo (lldb::RegisterKind reg_kind, uint32_t reg_num) |
| uint64_t | GetPC (uint64_t fail_value=LLDB_INVALID_ADDRESS) |
| uint64_t | GetThreadPointer (uint64_t fail_value=LLDB_INVALID_ADDRESS) |
| bool | GetPCForSymbolication (Address &address) |
| Get an address suitable for symbolication. | |
| bool | SetPC (uint64_t pc) |
| bool | SetPC (Address addr) |
| uint64_t | GetSP (uint64_t fail_value=LLDB_INVALID_ADDRESS) |
| bool | SetSP (uint64_t sp) |
| uint64_t | GetFP (uint64_t fail_value=LLDB_INVALID_ADDRESS) |
| bool | SetFP (uint64_t fp) |
| const char * | GetRegisterName (uint32_t reg) |
| uint64_t | GetReturnAddress (uint64_t fail_value=LLDB_INVALID_ADDRESS) |
| uint64_t | GetFlags (uint64_t fail_value=0) |
| uint64_t | ReadRegisterAsUnsigned (uint32_t reg, uint64_t fail_value) |
| uint64_t | ReadRegisterAsUnsigned (const RegisterInfo *reg_info, uint64_t fail_value) |
| bool | WriteRegisterFromUnsigned (uint32_t reg, uint64_t uval) |
| bool | WriteRegisterFromUnsigned (const RegisterInfo *reg_info, uint64_t uval) |
| bool | ConvertBetweenRegisterKinds (lldb::RegisterKind source_rk, uint32_t source_regnum, lldb::RegisterKind target_rk, uint32_t &target_regnum) |
| lldb::TargetSP | CalculateTarget () override |
| lldb::ProcessSP | CalculateProcess () override |
| lldb::ThreadSP | CalculateThread () override |
| lldb::StackFrameSP | CalculateStackFrame () override |
| void | CalculateExecutionContext (ExecutionContext &exe_ctx) override |
| Reconstruct the object's execution context into sc. | |
| uint32_t | GetStopID () const |
| void | SetStopID (uint32_t stop_id) |
| Public Member Functions inherited from lldb_private::ExecutionContextScope | |
| virtual | ~ExecutionContextScope ()=default |
Private Member Functions | |
| uint32_t | GetModuleID () |
| The module whose code this context's frame is executing. | |
Private Attributes | |
| std::unordered_map< size_t, std::unique_ptr< WasmVirtualRegisterInfo > > | m_register_map |
Additional Inherited Members | |
| Protected Member Functions inherited from lldb_private::process_gdb_remote::GDBRemoteRegisterContext | |
| bool | ReadRegisterBytes (const RegisterInfo *reg_info) |
| bool | WriteRegisterBytes (const RegisterInfo *reg_info, DataExtractor &data, uint32_t data_offset) |
| bool | PrivateSetRegisterValue (uint32_t reg, llvm::ArrayRef< uint8_t > data) |
| bool | PrivateSetRegisterValue (uint32_t reg, uint64_t val) |
| void | SetAllRegistersValid () |
| void | SetAllRegistersUnfetched () |
| bool | GetRegisterIsValid (uint32_t reg) const |
| bool | GetRegisterIsUnavailable (uint32_t reg) const |
| bool | GetRegisterIsUnfetched (uint32_t reg) const |
| void | SetRegisterIsValid (const RegisterInfo *reg_info) |
| void | SetRegisterIsUnavailable (const RegisterInfo *reg_info) |
| void | SetRegisterIsUnfetched (const RegisterInfo *reg_info) |
| void | SetRegisterIsValid (uint32_t reg) |
| void | SetRegisterIsUnavailable (uint32_t reg) |
| void | SetRegisterIsUnfetched (uint32_t reg) |
| Protected Member Functions inherited from lldb_private::RegisterContext | |
| virtual bool | BehavesLikeZerothFrame () const |
| Indicates that this frame is currently executing code, that the PC value is not a return-pc but an actual executing instruction. | |
| Protected Attributes inherited from lldb_private::process_gdb_remote::GDBRemoteRegisterContext | |
| lldb::DynamicRegisterInfoSP | m_reg_info_sp |
| std::vector< LazyBool > | m_reg_valid |
| eLazyBoolYes - we have the bytes for this register locally. | |
| DataExtractor | m_reg_data |
| bool | m_read_all_at_once |
| bool | m_write_all_at_once |
| bool | m_gpacket_cached |
| Protected Attributes inherited from lldb_private::RegisterContext | |
| Thread & | m_thread |
| uint32_t | m_concrete_frame_idx |
| uint32_t | m_stop_id |
Definition at line 34 of file RegisterContextWasm.h.
| RegisterContextWasm::RegisterContextWasm | ( | process_gdb_remote::ThreadGDBRemote & | thread, |
| uint32_t | concrete_frame_idx, | ||
| lldb::DynamicRegisterInfoSP | reg_info_sp ) |
Definition at line 24 of file RegisterContextWasm.cpp.
References lldb_private::process_gdb_remote::GDBRemoteRegisterContext::GDBRemoteRegisterContext(), and lldb_private::process_gdb_remote::GDBRemoteRegisterContext::ThreadGDBRemote.
|
overridedefault |
|
overridevirtual |
Convert from a given register numbering scheme to the lldb register numbering scheme.
There may be multiple ways to enumerate the registers for a given architecture. ABI references will specify one to be used with DWARF, the register numberings from process plugin, there may be a variation used for eh_frame unwind instructions (e.g. on Darwin), and so on. Register 5 by itself is meaningless - RegisterKind enumeration tells you what context that number should be translated as.
Inside lldb, register numbers are in the eRegisterKindLLDB scheme; arguments which take a register number should take one in that scheme.
eRegisterKindGeneric is a special numbering scheme which gives us constant values for the pc, frame register, stack register, etc., for use within lldb. They may not be defined for all architectures but it allows generic code to translate these common registers into the lldb numbering scheme.
This method translates a given register kind + register number into the eRegisterKindLLDB register numbering.
| [in] | kind | The register numbering scheme (RegisterKind) that the following register number is in. |
| [in] | num | A register number in the 'kind' register numbering scheme. |
Reimplemented from lldb_private::process_gdb_remote::GDBRemoteRegisterContext.
Definition at line 36 of file RegisterContextWasm.cpp.
|
private |
The module whose code this context's frame is executing.
Resolved on each use rather than cached: the innermost frame's register context is the thread's own and outlives a stop, so a cached id would go on naming the module of a previous stop.
Definition at line 32 of file RegisterContextWasm.cpp.
References lldb_private::RegisterContext::GetPC(), lldb_private::wasm::GetWasmModuleID(), and LLDB_INVALID_ADDRESS.
Referenced by ReadRegister().
|
overridevirtual |
Reimplemented from lldb_private::process_gdb_remote::GDBRemoteRegisterContext.
Definition at line 41 of file RegisterContextWasm.cpp.
|
overridevirtual |
Reimplemented from lldb_private::process_gdb_remote::GDBRemoteRegisterContext.
Definition at line 46 of file RegisterContextWasm.cpp.
References lldb_private::eWasmTagNotAWasmLocation, lldb_private::GetWasmVirtualRegisterIndex(), lldb_private::GetWasmVirtualRegisterTag(), lldb_private::process_gdb_remote::GDBRemoteRegisterContext::m_reg_info_sp, and m_register_map.
|
overridevirtual |
Reimplemented from lldb_private::process_gdb_remote::GDBRemoteRegisterContext.
Definition at line 64 of file RegisterContextWasm.cpp.
|
overridevirtual |
Reimplemented from lldb_private::process_gdb_remote::GDBRemoteRegisterContext.
Definition at line 62 of file RegisterContextWasm.cpp.
|
overridevirtual |
Reimplemented from lldb_private::process_gdb_remote::GDBRemoteRegisterContext.
Definition at line 133 of file RegisterContextWasm.cpp.
|
overridevirtual |
Reimplemented from lldb_private::process_gdb_remote::GDBRemoteRegisterContext.
Definition at line 84 of file RegisterContextWasm.cpp.
References lldb_private::RegisterInfo::byte_offset, lldb_private::RegisterInfo::byte_size, lldb::eEncodingUint, lldb_private::RegisterInfo::encoding, error(), lldb_private::Process::GetAddressByteSize(), lldb_private::Process::GetByteOrder(), lldb_private::wasm::ThreadWasm::GetConcreteFramePC(), lldb_private::GetLog(), GetModuleID(), lldb_private::Thread::GetProcess(), lldb_private::RegisterContext::GetThread(), LLDB_INVALID_ADDRESS, LLDB_LOG_ERROR, lldb_private::RegisterContext::m_concrete_frame_idx, lldb_private::RegisterInfo::name, pc, lldb_private::Process, lldb_private::process_gdb_remote::GDBRemoteRegisterContext::ReadRegister(), ReadWasmValue(), lldb_private::RegisterValue::SetUInt(), and lldb_private::RegisterValue::SetValueFromData().
|
overridevirtual |
Reimplemented from lldb_private::process_gdb_remote::GDBRemoteRegisterContext.
Definition at line 135 of file RegisterContextWasm.cpp.
References lldb_private::RegisterInfo::name, and lldb_private::process_gdb_remote::GDBRemoteRegisterContext::WriteRegister().
|
private |
Definition at line 70 of file RegisterContextWasm.h.
Referenced by GetRegisterInfoAtIndex().