[PATCH] D76877: Implement DW_CFA_LLVM_* for Heterogeneous Debugging

Greg Clayton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 21 15:30:00 PDT 2021


clayborg requested changes to this revision.
clayborg added inline comments.
This revision now requires changes to proceed.


================
Comment at: llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h:53-56
+    /// Register is in or at a register plus offset in specified address space:
+    ///   reg = reg + offset in addrspace
+    ///   reg = deref(reg + offset in addrspace)
+    RegPlusOffsetInAddrSpace,
----------------
I don't think we need the "RegPlusOffsetInAddrSpace" enumeration here, we can just use "RegPlusOffset" as the AddrSpace could be used for RegPlusOffset or CFAPlusOffset.


================
Comment at: llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h:83-84
 
   UnwindLocation(Location K, uint32_t Reg, int32_t Off, bool Deref)
       : Kind(K), RegNum(Reg), Offset(Off), Dereference(Deref) {}
 
----------------



================
Comment at: llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h:86-88
+  UnwindLocation(Location K, uint32_t Reg, int32_t Off, uint32_t AS, bool Deref)
+      : Kind(K), RegNum(Reg), Offset(Off), AddrSpace(AS), Dereference(Deref) {}
+
----------------
Revert and use above constructor


================
Comment at: llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h:110-111
   /// information.
   static UnwindLocation createIsCFAPlusOffset(int32_t Off);
   static UnwindLocation createAtCFAPlusOffset(int32_t Off);
   /// Create a location where the saved value is in (Deref == false) or at
----------------
You could add address space args to this as well, not required though


================
Comment at: llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h:120-125
   static UnwindLocation createIsRegisterPlusOffset(uint32_t Reg, int32_t Off);
   static UnwindLocation createAtRegisterPlusOffset(uint32_t Reg, int32_t Off);
+  static UnwindLocation
+  createIsRegisterPlusOffsetInAddrSpace(uint32_t Reg, int32_t Off, uint32_t AS);
+  static UnwindLocation
+  createAtRegisterPlusOffsetInAddrSpace(uint32_t Reg, int32_t Off, uint32_t AS);
----------------



================
Comment at: llvm/include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h:136-139
+  uint32_t getAddressSpace() const {
+    assert(Kind == RegPlusOffsetInAddrSpace && AddrSpace.hasValue());
+    return *AddrSpace;
+  }
----------------



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76877/new/

https://reviews.llvm.org/D76877



More information about the llvm-commits mailing list