class Registers
Defined at line 137 of file ../../src/lib/unwinder/registers.h
Holds the register values. It's possible to get and set a register id that is not listed above.
Public Methods
fit::result<Error, Registers> To32Bit ()
Converts the current register object to the equivalent 32 bit register set. This means that
all general purpose registers are copied wholesale (without checking if the value can actually
fit in a 32 bit register), and the specially named registers are copied using the getters and
setters below.
Defined at line 119 of file ../../src/lib/unwinder/registers.cc
Error Get (RegisterID reg_id, uint64_t & val)
Defined at line 82 of file ../../src/lib/unwinder/registers.cc
Error Set (RegisterID reg_id, uint64_t val)
Defined at line 91 of file ../../src/lib/unwinder/registers.cc
Error Unset (RegisterID reg_id)
Defined at line 96 of file ../../src/lib/unwinder/registers.cc
Error GetSP (uint64_t & sp)
Defined at line 101 of file ../../src/lib/unwinder/registers.cc
Error SetSP (uint64_t sp)
Defined at line 102 of file ../../src/lib/unwinder/registers.cc
Error GetPC (uint64_t & pc)
Defined at line 104 of file ../../src/lib/unwinder/registers.cc
Error SetPC (uint64_t pc)
Defined at line 105 of file ../../src/lib/unwinder/registers.cc
Error GetFP (uint64_t & fp)
Defined at line 107 of file ../../src/lib/unwinder/registers.cc
Error SetFP (uint64_t fp)
Defined at line 108 of file ../../src/lib/unwinder/registers.cc
Error GetSCS (uint64_t & scs)
Defined at line 110 of file ../../src/lib/unwinder/registers.cc
Error SetSCS (uint64_t scs)
Defined at line 111 of file ../../src/lib/unwinder/registers.cc
Error GetReturnAddress (uint64_t & ra)
These are not formally specified for all architectures, but we define aliases for them.
It's RIP on x64, LR on Arm64, R14 on Arm, and RA on Riscv64. See the note above for why this
doesn't necessarily always make sense for x64.
Defined at line 113 of file ../../src/lib/unwinder/registers.cc
Error SetReturnAddress (uint64_t ra)
Defined at line 117 of file ../../src/lib/unwinder/registers.cc
void Registers (Arch arch)
Defined at line 146 of file ../../src/lib/unwinder/registers.h
Arch arch ()
Defined at line 155 of file ../../src/lib/unwinder/registers.h
size_type size ()
Delegate size(), begin() and end() to regs_.
Defined at line 158 of file ../../src/lib/unwinder/registers.h
const_iterator begin ()
Defined at line 159 of file ../../src/lib/unwinder/registers.h
const_iterator end ()
Defined at line 160 of file ../../src/lib/unwinder/registers.h
Error AdjustPCForThumb ()
Defined at line 160 of file ../../src/lib/unwinder/registers.cc
template <auto value_projection>
auto WithNames (auto value_projection)
Yields a range of std::pair
<std
::string, uint64_t>, with the rhs actually
being whatever value_projection returns when called on uint64_t.
Defined at line 164 of file ../../src/lib/unwinder/registers.h
decltype(transform_view<views::all_t<const std::map<unwinder::RegisterID, unsigned long, std::less<unwinder::RegisterID>, std::allocator<std::pair<const unwinder::RegisterID, unsigned long>>> &>, (lambda at ../../src/lib/unwinder/registers.h:165:41)>(std::forward<const std::map<unwinder::RegisterID, unsigned long> &>(__range), std::forward<(lambda at ../../src/lib/unwinder/registers.h:165:41)>(__f))) WithNames ()
Defined at line 170 of file ../../src/lib/unwinder/registers.h
std::string Describe ()
Return a string describing the value of all registers. Should be useful in debugging.
Defined at line 181 of file ../../src/lib/unwinder/registers.cc
void Clear ()
Defined at line 194 of file ../../src/lib/unwinder/registers.h
Enumerations
enum class Arch
| Name | Value |
|---|---|
| kX64 | 0 |
| kArm32 | 1 |
| kArm64 | 2 |
| kRiscv64 | 3 |
Defined at line 139 of file ../../src/lib/unwinder/registers.h