diff options
Diffstat (limited to 'libunwindstack/include')
| -rw-r--r-- | libunwindstack/include/unwindstack/DwarfLocation.h | 1 | ||||
| -rw-r--r-- | libunwindstack/include/unwindstack/DwarfSection.h | 11 | ||||
| -rw-r--r-- | libunwindstack/include/unwindstack/MachineArm64.h | 7 | ||||
| -rw-r--r-- | libunwindstack/include/unwindstack/Regs.h | 4 | ||||
| -rw-r--r-- | libunwindstack/include/unwindstack/RegsArm64.h | 15 |
5 files changed, 34 insertions, 4 deletions
diff --git a/libunwindstack/include/unwindstack/DwarfLocation.h b/libunwindstack/include/unwindstack/DwarfLocation.h index 3d50ccf369..bf45bc7528 100644 --- a/libunwindstack/include/unwindstack/DwarfLocation.h +++ b/libunwindstack/include/unwindstack/DwarfLocation.h @@ -33,6 +33,7 @@ enum DwarfLocationEnum : uint8_t { DWARF_LOCATION_REGISTER, DWARF_LOCATION_EXPRESSION, DWARF_LOCATION_VAL_EXPRESSION, + DWARF_LOCATION_PSEUDO_REGISTER, }; struct DwarfLocation { diff --git a/libunwindstack/include/unwindstack/DwarfSection.h b/libunwindstack/include/unwindstack/DwarfSection.h index c244749c19..af823da5f9 100644 --- a/libunwindstack/include/unwindstack/DwarfSection.h +++ b/libunwindstack/include/unwindstack/DwarfSection.h @@ -31,6 +31,7 @@ namespace unwindstack { // Forward declarations. +enum ArchEnum : uint8_t; class Memory; class Regs; template <typename AddressType> @@ -90,13 +91,14 @@ class DwarfSection { virtual bool Eval(const DwarfCie*, Memory*, const dwarf_loc_regs_t&, Regs*, bool*) = 0; - virtual bool Log(uint8_t indent, uint64_t pc, const DwarfFde* fde) = 0; + virtual bool Log(uint8_t indent, uint64_t pc, const DwarfFde* fde, ArchEnum arch) = 0; virtual void GetFdes(std::vector<const DwarfFde*>* fdes) = 0; virtual const DwarfFde* GetFdeFromPc(uint64_t pc) = 0; - virtual bool GetCfaLocationInfo(uint64_t pc, const DwarfFde* fde, dwarf_loc_regs_t* loc_regs) = 0; + virtual bool GetCfaLocationInfo(uint64_t pc, const DwarfFde* fde, dwarf_loc_regs_t* loc_regs, + ArchEnum arch) = 0; virtual uint64_t GetCieOffsetFromFde32(uint32_t pointer) = 0; @@ -140,9 +142,10 @@ class DwarfSectionImpl : public DwarfSection { bool Eval(const DwarfCie* cie, Memory* regular_memory, const dwarf_loc_regs_t& loc_regs, Regs* regs, bool* finished) override; - bool GetCfaLocationInfo(uint64_t pc, const DwarfFde* fde, dwarf_loc_regs_t* loc_regs) override; + bool GetCfaLocationInfo(uint64_t pc, const DwarfFde* fde, dwarf_loc_regs_t* loc_regs, + ArchEnum arch) override; - bool Log(uint8_t indent, uint64_t pc, const DwarfFde* fde) override; + bool Log(uint8_t indent, uint64_t pc, const DwarfFde* fde, ArchEnum arch) override; protected: bool GetNextCieOrFde(const DwarfFde** fde_entry); diff --git a/libunwindstack/include/unwindstack/MachineArm64.h b/libunwindstack/include/unwindstack/MachineArm64.h index e953335101..358e3d9898 100644 --- a/libunwindstack/include/unwindstack/MachineArm64.h +++ b/libunwindstack/include/unwindstack/MachineArm64.h @@ -60,6 +60,13 @@ enum Arm64Reg : uint16_t { ARM64_REG_SP = ARM64_REG_R31, ARM64_REG_LR = ARM64_REG_R30, + + // Pseudo registers. These are not machine registers. + + // AARCH64 Return address signed state pseudo-register + ARM64_PREG_RA_SIGN_STATE = 34, + ARM64_PREG_FIRST = ARM64_PREG_RA_SIGN_STATE, + ARM64_PREG_LAST, }; } // namespace unwindstack diff --git a/libunwindstack/include/unwindstack/Regs.h b/libunwindstack/include/unwindstack/Regs.h index a367e6cf17..5f42565676 100644 --- a/libunwindstack/include/unwindstack/Regs.h +++ b/libunwindstack/include/unwindstack/Regs.h @@ -64,6 +64,10 @@ class Regs { uint64_t dex_pc() { return dex_pc_; } void set_dex_pc(uint64_t dex_pc) { dex_pc_ = dex_pc; } + virtual void ResetPseudoRegisters() {} + virtual bool SetPseudoRegister(uint16_t, uint64_t) { return false; } + virtual bool GetPseudoRegister(uint16_t, uint64_t*) { return false; } + virtual bool StepIfSignalHandler(uint64_t elf_offset, Elf* elf, Memory* process_memory) = 0; virtual bool SetPcFromReturnAddress(Memory* process_memory) = 0; diff --git a/libunwindstack/include/unwindstack/RegsArm64.h b/libunwindstack/include/unwindstack/RegsArm64.h index 2b3ddeb77a..bf7ab15275 100644 --- a/libunwindstack/include/unwindstack/RegsArm64.h +++ b/libunwindstack/include/unwindstack/RegsArm64.h @@ -22,6 +22,7 @@ #include <functional> #include <unwindstack/Elf.h> +#include <unwindstack/MachineArm64.h> #include <unwindstack/Regs.h> namespace unwindstack { @@ -48,11 +49,25 @@ class RegsArm64 : public RegsImpl<uint64_t> { void set_pc(uint64_t pc) override; void set_sp(uint64_t sp) override; + void ResetPseudoRegisters() override; + + bool SetPseudoRegister(uint16_t id, uint64_t value) override; + + bool GetPseudoRegister(uint16_t id, uint64_t* value) override; + + bool IsRASigned(); + + void SetPACMask(uint64_t mask); + Regs* Clone() override final; static Regs* Read(void* data); static Regs* CreateFromUcontext(void* ucontext); + + protected: + uint64_t pseudo_regs_[Arm64Reg::ARM64_PREG_LAST - Arm64Reg::ARM64_PREG_FIRST]; + uint64_t pac_mask_; }; } // namespace unwindstack |
