diff options
author | Sergey Andreenko <seandree@microsoft.com> | 2016-12-08 14:42:56 -0800 |
---|---|---|
committer | Sergey Andreenko <seandree@microsoft.com> | 2016-12-08 15:59:26 -0800 |
commit | 26880afb0a4d8aaa7dd40d864b77b98602b6c981 (patch) | |
tree | f1ceea4e310489dd829d551319c7398d710ef214 /src/jit | |
parent | e06afa73cc284c6659a03eb475eb426d08938e77 (diff) | |
download | coreclr-26880afb0a4d8aaa7dd40d864b77b98602b6c981.tar.gz coreclr-26880afb0a4d8aaa7dd40d864b77b98602b6c981.tar.bz2 coreclr-26880afb0a4d8aaa7dd40d864b77b98602b6c981.zip |
Fix unix unwind info
Windows uses offset from stack pointer, when unix has to use offset from
caninical frame address,
Diffstat (limited to 'src/jit')
-rw-r--r-- | src/jit/unwindamd64.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/jit/unwindamd64.cpp b/src/jit/unwindamd64.cpp index 89abdff2b3..14eba8cb50 100644 --- a/src/jit/unwindamd64.cpp +++ b/src/jit/unwindamd64.cpp @@ -481,6 +481,13 @@ void Compiler::unwindSetFrameRegWindows(regNumber reg, unsigned offset) } #ifdef UNIX_AMD64_ABI +//------------------------------------------------------------------------ +// Compiler::unwindSetFrameRegCFI: Record a cfi info for a frame register set. +// +// Arguments: +// reg - The register being set as the frame register. +// offset - The offset from the current stack pointer that the frame pointer will point at. +// void Compiler::unwindSetFrameRegCFI(regNumber reg, unsigned offset) { assert(compGeneratingProlog); @@ -492,7 +499,13 @@ void Compiler::unwindSetFrameRegCFI(regNumber reg, unsigned offset) createCfiCode(func, cbProlog, CFI_DEF_CFA_REGISTER, mapRegNumToDwarfReg(reg)); if (offset != 0) { - createCfiCode(func, cbProlog, CFI_ADJUST_CFA_OFFSET, DWARF_REG_ILLEGAL, offset); + // before: cfa = rsp + old_cfa_offset; + // rbp = rsp + offset; + // after: cfa should be based on rbp, but points to the old address: + // rsp + old_cfa_offset == rbp + old_cfa_offset + adjust; + // adjust = -offset; + int adjust = -(int)offset; + createCfiCode(func, cbProlog, CFI_ADJUST_CFA_OFFSET, DWARF_REG_ILLEGAL, adjust); } } #endif // UNIX_AMD64_ABI |