Skip to content

Commit 5edf586

Browse files
authored
[AArch64][Windows] Add llvm-readobj support for ec_context unwind opcode (#69515)
ARM64EC uses the same CONTEXT structure as x86_64 as opposed to the regular ARM64 context, a new unwind opcode MSFT_OP_EC_CONTEXT is added to handle this.
1 parent 63917e1 commit 5edf586

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ const Decoder::RingEntry Decoder::Ring64[] = {
171171
{0xff, 0xe8, 1, &Decoder::opcode_trap_frame},
172172
{0xff, 0xe9, 1, &Decoder::opcode_machine_frame},
173173
{0xff, 0xea, 1, &Decoder::opcode_context},
174+
{0xff, 0xeb, 1, &Decoder::opcode_ec_context},
174175
{0xff, 0xec, 1, &Decoder::opcode_clear_unwound_to_call},
175176
{0xff, 0xfc, 1, &Decoder::opcode_pac_sign_lr},
176177
};
@@ -969,6 +970,13 @@ bool Decoder::opcode_context(const uint8_t *OC, unsigned &Offset,
969970
return false;
970971
}
971972

973+
bool Decoder::opcode_ec_context(const uint8_t *OC, unsigned &Offset,
974+
unsigned Length, bool Prologue) {
975+
SW.startLine() << format("0x%02x ; EC context\n", OC[Offset]);
976+
++Offset;
977+
return false;
978+
}
979+
972980
bool Decoder::opcode_clear_unwound_to_call(const uint8_t *OC, unsigned &Offset,
973981
unsigned Length, bool Prologue) {
974982
SW.startLine() << format("0x%02x ; clear unwound to call\n",

llvm/tools/llvm-readobj/ARMWinEHPrinter.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ class Decoder {
129129
unsigned Length, bool Prologue);
130130
bool opcode_context(const uint8_t *Opcodes, unsigned &Offset, unsigned Length,
131131
bool Prologue);
132+
bool opcode_ec_context(const uint8_t *Opcodes, unsigned &Offset,
133+
unsigned Length, bool Prologue);
132134
bool opcode_clear_unwound_to_call(const uint8_t *Opcodes, unsigned &Offset,
133135
unsigned Length, bool Prologue);
134136
bool opcode_pac_sign_lr(const uint8_t *Opcodes, unsigned &Offset,

0 commit comments

Comments
 (0)