For mips we reduce pc by 8 in function StackTrace::GetPreviousInstructionPc. Therefore we need to increase pc by 8 here to get the correct address in the stacktrace.
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
This is not specific to this particular test. Please add kPCInc constant to test.h file and use the const here.
Comment Actions
I see that StackTrace::GetPreviousInstructionPc special cases not just mips. Please duplicate what StackTrace::GetPreviousInstructionPc does, and comment that it must be in sync with StackTrace::GetPreviousInstructionPc. Also we never increase indentation level after #if (at least not in this file), so start "const int kPCInc" from the first column.
Here is what StackTrace::GetPreviousInstructionPc does:
#if defined(powerpc) || defined(powerpc64)
// PCs are always 4 byte aligned. return pc - 4;
#elif defined(sparc) || defined(mips)
return pc - 8;
#else
return pc - 1;
#endif
Comment Actions
Fixed indentation and duplicated code of StackTrace::GetPreviousInstructionPc in test.h