summaryrefslogtreecommitdiff
path: root/src/jit
diff options
context:
space:
mode:
authorsandreenko <seandree@microsoft.com>2016-12-08 17:56:58 -0800
committerGitHub <noreply@github.com>2016-12-08 17:56:58 -0800
commit71f0a531679506311b5accab3bd13f4b717029a2 (patch)
tree9abd4f992a42ce10d708d35de190d05f810b9399 /src/jit
parentb2a083a09692e405e5dca17fa0ab04a886a2ce27 (diff)
parent26880afb0a4d8aaa7dd40d864b77b98602b6c981 (diff)
downloadcoreclr-71f0a531679506311b5accab3bd13f4b717029a2.tar.gz
coreclr-71f0a531679506311b5accab3bd13f4b717029a2.tar.bz2
coreclr-71f0a531679506311b5accab3bd13f4b717029a2.zip
Merge pull request #8539 from sandreenko/fix-unix-unwind-info
Fix unix unwind info
Diffstat (limited to 'src/jit')
-rw-r--r--src/jit/unwindamd64.cpp15
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