[Lldb-commits] [lldb] [lldb] Implement RISCV function unwinding using instruction emulation (PR #147434)

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 15 09:54:25 PDT 2025


================
@@ -57,11 +57,12 @@ class EmulateInstructionRISCV : public EmulateInstruction {
 
   static bool SupportsThisInstructionType(InstructionType inst_type) {
     switch (inst_type) {
-    case eInstructionTypeAny:
-    case eInstructionTypePCModifying:
+    case lldb_private::eInstructionTypeAny:
+    case lldb_private::eInstructionTypePrologueEpilogue:
       return true;
-    case eInstructionTypePrologueEpilogue:
-    case eInstructionTypeAll:
+
+    case lldb_private::eInstructionTypePCModifying:
----------------
clayborg wrote:

I told Satya to try this, but it seems they must have been already emulating PC modifying instructions. We don't get any backtrace if we don't say we handle `eInstructionTypePrologueEpilogue` and when we changed it we did get a backtrace. If we don't return true for `eInstructionTypePrologueEpilogue` then `EmulateInstructionRISCV::CreateFunctionEntryUnwind()` never gets called. But it sounds like we need to modify the instruction emulator to handle the prologue opcodes for this patch.

https://github.com/llvm/llvm-project/pull/147434


More information about the lldb-commits mailing list