diff options
Diffstat (limited to 'include/lldb/Target/RegisterContext.h')
-rw-r--r-- | include/lldb/Target/RegisterContext.h | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/include/lldb/Target/RegisterContext.h b/include/lldb/Target/RegisterContext.h index 421acc03cb22..9108d4575259 100644 --- a/include/lldb/Target/RegisterContext.h +++ b/include/lldb/Target/RegisterContext.h @@ -86,9 +86,44 @@ public: bool CopyFromRegisterContext (lldb::RegisterContextSP context); - + + //------------------------------------------------------------------ + /// 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 stabs (aka "gcc"), 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. + /// + /// @param [in] kind + /// The register numbering scheme (RegisterKind) that the following + /// register number is in. + /// + /// @param [in] num + /// A register number in the 'kind' register numbering scheme. + /// + /// @return + /// The equivalent register number in the eRegisterKindLLDB + /// numbering scheme, if possible, else LLDB_INVALID_REGNUM. + //------------------------------------------------------------------ virtual uint32_t - ConvertRegisterKindToRegisterNumber (uint32_t kind, uint32_t num) = 0; + ConvertRegisterKindToRegisterNumber (lldb::RegisterKind kind, uint32_t num) = 0; //------------------------------------------------------------------ // Subclasses can override these functions if desired @@ -136,7 +171,7 @@ public: GetRegisterInfoByName (const char *reg_name, uint32_t start_idx = 0); const RegisterInfo * - GetRegisterInfo (uint32_t reg_kind, uint32_t reg_num); + GetRegisterInfo (lldb::RegisterKind reg_kind, uint32_t reg_num); uint64_t GetPC (uint64_t fail_value = LLDB_INVALID_ADDRESS); @@ -179,7 +214,7 @@ public: bool WriteRegisterFromUnsigned (const RegisterInfo *reg_info, uint64_t uval); bool - ConvertBetweenRegisterKinds (int source_rk, uint32_t source_regnum, int target_rk, uint32_t& target_regnum); + ConvertBetweenRegisterKinds (lldb::RegisterKind source_rk, uint32_t source_regnum, lldb::RegisterKind target_rk, uint32_t& target_regnum); //------------------------------------------------------------------ // lldb::ExecutionContextScope pure virtual functions |