Path: blob/main/contrib/llvm-project/lldb/source/Plugins/Instruction/ARM/EmulationStateARM.h
39645 views
//===-- EmulationStateARM.h -------------------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLDB_SOURCE_PLUGINS_INSTRUCTION_ARM_EMULATIONSTATEARM_H9#define LLDB_SOURCE_PLUGINS_INSTRUCTION_ARM_EMULATIONSTATEARM_H1011#include <map>1213#include "lldb/Core/EmulateInstruction.h"14#include "lldb/Core/Opcode.h"1516class EmulationStateARM {17public:18EmulationStateARM();1920virtual ~EmulationStateARM();2122bool StorePseudoRegisterValue(uint32_t reg_num, uint64_t value);2324uint64_t ReadPseudoRegisterValue(uint32_t reg_num, bool &success);2526bool StoreToPseudoAddress(lldb::addr_t p_address, uint32_t value);2728uint32_t ReadFromPseudoAddress(lldb::addr_t p_address, bool &success);2930void ClearPseudoRegisters();3132void ClearPseudoMemory();3334bool LoadStateFromDictionary(lldb_private::OptionValueDictionary *test_data);3536bool CompareState(EmulationStateARM &other_state,37lldb_private::Stream &out_stream);3839static size_t40ReadPseudoMemory(lldb_private::EmulateInstruction *instruction, void *baton,41const lldb_private::EmulateInstruction::Context &context,42lldb::addr_t addr, void *dst, size_t length);4344static size_t45WritePseudoMemory(lldb_private::EmulateInstruction *instruction, void *baton,46const lldb_private::EmulateInstruction::Context &context,47lldb::addr_t addr, const void *dst, size_t length);4849static bool ReadPseudoRegister(lldb_private::EmulateInstruction *instruction,50void *baton,51const lldb_private::RegisterInfo *reg_info,52lldb_private::RegisterValue ®_value);5354static bool55WritePseudoRegister(lldb_private::EmulateInstruction *instruction,56void *baton,57const lldb_private::EmulateInstruction::Context &context,58const lldb_private::RegisterInfo *reg_info,59const lldb_private::RegisterValue ®_value);6061private:62bool LoadRegistersStateFromDictionary(63lldb_private::OptionValueDictionary *reg_dict, char kind, int first_reg,64int num);6566uint32_t m_gpr[17] = {0};67struct _sd_regs {68uint32_t s_regs[32]; // sregs 0 - 31 & dregs 0 - 156970uint64_t d_regs[16]; // dregs 16-317172} m_vfp_regs;7374std::map<lldb::addr_t, uint32_t> m_memory; // Eventually will want to change75// uint32_t to a data buffer heap76// type.7778EmulationStateARM(const EmulationStateARM &) = delete;79const EmulationStateARM &operator=(const EmulationStateARM &) = delete;80};8182#endif // LLDB_SOURCE_PLUGINS_INSTRUCTION_ARM_EMULATIONSTATEARM_H838485