Fix prologue and epilogue handling in UnwindAssemblyInstEmulation
Details
Diff Detail
Event Timeline
Added some inline comment to explain the reason behind each change
source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp | ||
---|---|---|
162–196 | We have to create the new CFA row before processing the instruction following the return-to-caller instruction so it will be valid for the instruction immediately after the return-to-caller instruction and if the next instruction change the CFA then it have the correct base information. This have to be done even if the current instruction will change the CFA row to have the right data for the current instruction. | |
175 | When we create a new row from the saved prologue CFA row we should start it from the current instruction, not from the next one. Previously it was: m_curr_row->SetOffset (inst->GetAddress().GetFileAddress() + inst->GetOpcode().GetByteSize() - base_addr); | |
257–265 | We have to save the prologue CFA also if the last instruction changed the CFA because when the following instruction is detected as part of the epilogue then the prologue CFA will never be saved. | |
641–642 | eContextRegisterLoad can happen as part of the prologue when the value of some register is initialized with constants. On android-arm it is done by loading data from a PC relative address with the LDR instruction using the mixed code and data segments. | |
source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h | ||
186–187 | This variable only used to detect when we can't be in the prologue because of an instruction what should only appear in the epilogue. Rename it accordingly. |
This variable only used to detect when we can't be in the prologue because of an instruction what should only appear in the epilogue. Rename it accordingly.