65 uint8_t* pLocation =
reinterpret_cast<uint8_t*
>(nLocation);
68 if ((pLocation[0] & 0xc0) == DW_CFA_advance_loc) {
69 uint8_t nDelta = pLocation[0] & 0x3f;
72 }
else if ((pLocation[0] & 0xc0) == DW_CFA_offset) {
73 uint8_t nRegister = pLocation[0] & 0x3f;
74 uint32_t nLocationOffset = 0;
75 pLocation =
reinterpret_cast<uint8_t*
>(nLocation);
78 nLocation += nLocationOffset;
83 }
else if ((pLocation[0] & 0xc0) == DW_CFA_restore) {
86 switch (pLocation[0]) {
91 case DW_CFA_set_loc: {
92 processor_register_t* pAddress =
reinterpret_cast<processor_register_t*
>(nLocation);
94 nLocation +=
sizeof(processor_register_t);
98 case DW_CFA_advance_loc1: {
99 uint8_t nDelta = *
reinterpret_cast<uint8_t*
>(nLocation);
106 case DW_CFA_advance_loc2: {
107 uint16_t nDelta = *
reinterpret_cast<uint16_t*
>(nLocation);
114 case DW_CFA_advance_loc4: {
115 uint32_t nDelta = *
reinterpret_cast<uint32_t*
>(nLocation);
143 case DW_CFA_def_cfa: {
144 uint32_t nOffset = 0;
145 pLocation =
reinterpret_cast<uint8_t*
>(nLocation);
150 nLocation += nOffset;
156 case DW_CFA_def_cfa_register: {
157 uint32_t nOffset = 0;
158 pLocation =
reinterpret_cast<uint8_t*
>(nLocation);
160 nLocation += nOffset;
165 case DW_CFA_def_cfa_offset: {
166 uint32_t nOffset = 0;
167 pLocation =
reinterpret_cast<uint8_t*
>(nLocation);
170 nLocation += nOffset;
181 case DW_CFA_offset_extended_sf: {
182 uint32_t nLocationOffset = 0;
183 pLocation =
reinterpret_cast<uint8_t*
>(nLocation);
185 nLocation += nLocationOffset;
188 pLocation =
reinterpret_cast<uint8_t*
>(nLocation);
191 nLocation += nLocationOffset;
221 case DW_CFA_GNU_args_size: {
222 uint32_t nLocationOffset = 0;
223 pLocation =
reinterpret_cast<uint8_t*
>(nLocation);
225 nLocation += nLocationOffset;
229 ERROR(
"Unrecognised DWARF CFA instruction: " <<
Hex << pLocation[0]);
void initialise(const DwarfState &startingState, uintptr_t nCodeLocation, size_t nCodeLen, int32_t nCodeAlignmentFactor, int32_t nDataAlignmentFactor, uintptr_t nStartingPc)