[Lldb-commits] [lldb] [lldb][RISCV] Construct CSR information dynamically (PR #203234)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 13 09:49:13 PDT 2026


================
@@ -66,6 +66,20 @@ class RegisterContextCorePOSIX_riscv32 : public lldb_private::RegisterContext {
                        const lldb_private::ConstString &set_name,
                        uint32_t byte_offset);
 
+  /// \brief Retrieves enabled RISC-V ISA extension feature names from the
+  ///        module's ArchSpec.
+  ///
+  /// CSR metadata selection depends on which ISA extensions are enabled in the
+  /// debug target. This routine fetches the feature list from the module's
+  /// ArchSpec to select CSR patch sets during postmortem debugging.
+  ///
+  /// \param[out] features List of enabled ISA extension feature names. Returns
+  ///                      an empty list if the thread/process/target/module is
+  ///                      unavailable or the feature list is empty. Features
+  ///                      are normalized by stripping leading '+' and removing
+  ///                      empty entries.
----------------
JDevlieghere wrote:

StripFlag strips + and - (and disabled -ext features are kept), so "stripping leading '+'" is wrong. Should disabled features be filtered too?

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


More information about the lldb-commits mailing list