-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AArch64][Windows] Add llvm-readobj support for ec_context unwind opcode #69515
Conversation
@llvm/pr-subscribers-llvm-binary-utilities Author: Billy Laws (bylaws) ChangesARM64EC 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. Full diff: https://github.com/llvm/llvm-project/pull/69515.diff 2 Files Affected:
diff --git a/llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp b/llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp
index ef77d4b2fd224bd..cf5c77cf107c36f 100644
--- a/llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp
+++ b/llvm/tools/llvm-readobj/ARMWinEHPrinter.cpp
@@ -171,6 +171,7 @@ const Decoder::RingEntry Decoder::Ring64[] = {
{0xff, 0xe8, 1, &Decoder::opcode_trap_frame},
{0xff, 0xe9, 1, &Decoder::opcode_machine_frame},
{0xff, 0xea, 1, &Decoder::opcode_context},
+ {0xff, 0xeb, 1, &Decoder::opcode_ec_context},
{0xff, 0xec, 1, &Decoder::opcode_clear_unwound_to_call},
{0xff, 0xfc, 1, &Decoder::opcode_pac_sign_lr},
};
@@ -969,6 +970,13 @@ bool Decoder::opcode_context(const uint8_t *OC, unsigned &Offset,
return false;
}
+bool Decoder::opcode_ec_context(const uint8_t *OC, unsigned &Offset,
+ unsigned Length, bool Prologue) {
+ SW.startLine() << format("0x%02x ; EC context\n", OC[Offset]);
+ ++Offset;
+ return false;
+}
+
bool Decoder::opcode_clear_unwound_to_call(const uint8_t *OC, unsigned &Offset,
unsigned Length, bool Prologue) {
SW.startLine() << format("0x%02x ; clear unwound to call\n",
diff --git a/llvm/tools/llvm-readobj/ARMWinEHPrinter.h b/llvm/tools/llvm-readobj/ARMWinEHPrinter.h
index 0ffebe5834c480b..92b3a78e4330098 100644
--- a/llvm/tools/llvm-readobj/ARMWinEHPrinter.h
+++ b/llvm/tools/llvm-readobj/ARMWinEHPrinter.h
@@ -129,6 +129,8 @@ class Decoder {
unsigned Length, bool Prologue);
bool opcode_context(const uint8_t *Opcodes, unsigned &Offset, unsigned Length,
bool Prologue);
+ bool opcode_ec_context(const uint8_t *Opcodes, unsigned &Offset, unsigned Length,
+ bool Prologue);
bool opcode_clear_unwound_to_call(const uint8_t *Opcodes, unsigned &Offset,
unsigned Length, bool Prologue);
bool opcode_pac_sign_lr(const uint8_t *Opcodes, unsigned &Offset,
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change itself looks good, thanks!
This is lacking a test, but OTOH I don't see a standalone test for disassembling all the other corresponding opcodes either.
Many of them were added in llvm-readobj in the same commit as the MC layer code for assembling them, in f5e2ea9, so the readobj changes are covered by those MC tests at least.
So as long as this is merged close together with #69520 which does provide some test coverage for this, I think it's fine.
…ode (llvm#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.
…ode (llvm#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.
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.