diff options
author | Kyungwoo Lee <kyulee@microsoft.com> | 2016-01-23 06:13:58 -0800 |
---|---|---|
committer | Kyungwoo Lee <kyulee@microsoft.com> | 2016-01-28 13:03:04 -0800 |
commit | b5f2fda695bf450c2bb37bdc618bfbc604406bde (patch) | |
tree | 8a1070d53999932e07e6b69f29b5083c02258c5f /src/inc/clrnt.h | |
parent | 67a86c9e114593ce1d24ef7b8a943b86438c0e46 (diff) | |
download | coreclr-b5f2fda695bf450c2bb37bdc618bfbc604406bde.tar.gz coreclr-b5f2fda695bf450c2bb37bdc618bfbc604406bde.tar.bz2 coreclr-b5f2fda695bf450c2bb37bdc618bfbc604406bde.zip |
Support for CFI unwind info
For Unix targeting CoreRT, this will provide platform specific unwind
info which is a dwarf format.
Unlike window’s UNWIND_INFO, we won’t encode the format within RyuJit
since it is not only complex/error-prone but also needs to be adjusted
depending on platforms.
Instead, CFI (call frame information) pseudo instructions are encoded,
which will be passed to CoreRT/ObjectWriter which will translate
them to directly emit CFI directives to LLVM MC stream to establish
frames and layout eh_frame section.
A jit flag is used to dynamically dispatch either Windows’s unwind
blob or this CFI instruction table. No JIT/EE interface change is needed
since the API already expects an opaque blob.
Initially when I looked at what Clang does, the prologue and the
sequence of CFI emissions are a bit different than Windows.
Since we will emit the same sequence of code with the same runtime that
we define, I assume this is unnecessary – I’ve verified the CFI sequence
here can work correctly with libunwind.
Basically we need only 3 operations – push reg is a combination of 1 and
2 below.
1. Allocation – increase stack frame. Normally subtract esp in x64.
2. Store – Copy a (callee save) register to stack (memory)
3. SaveFP – Set frame pointer register
Since Windows operation is based on the relative value (all offsets,
etc are computed from the current point), I also use the similar form of
CFI instructions.
So, mostly one window’s code corresponds to two CFIs – we might optimize
this by aggregating allocation, but I’d like to keep the current
syntax/semantic same as Windows.
This results in a very simple transformation on par with Windows.
Diffstat (limited to 'src/inc/clrnt.h')
-rw-r--r-- | src/inc/clrnt.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/inc/clrnt.h b/src/inc/clrnt.h index cd21e2c6ec..5958906898 100644 --- a/src/inc/clrnt.h +++ b/src/inc/clrnt.h @@ -7,6 +7,7 @@ #define CLRNT_H_ #include "staticcontract.h" +#include "cfi.h" // // This file is the result of some changes to the SDK header files. |