[Lldb-commits] [lldb] [RISCV-LLDB] RISCV feature attribute support and allows overriding additional(default) feature (PR #147990)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 8 06:18:12 PDT 2025


================
@@ -1284,6 +1285,54 @@ ObjectFileELF::RefineModuleDetailsFromNote(lldb_private::DataExtractor &data,
   return error;
 }
 
+void ObjectFileELF::ParseRISCVAttributes(DataExtractor &data, uint64_t length,
+                                         ArchSpec &arch_spec) {
+  lldb::offset_t offset = 0;
+
+  uint8_t format_version = data.GetU8(&offset);
+  if (format_version != llvm::ELFAttrs::Format_Version)
+    return;
+
+  offset = offset + sizeof(uint32_t); // Section Length
+  llvm::StringRef vendor_name = data.GetCStr(&offset);
+
+  if (vendor_name != "riscv")
+    return;
----------------
DavidSpickett wrote:

Previously you do:
```
read thing
if thing is not whatever
  return
```
With no blank line before the if. I like that style, do that here.

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


More information about the lldb-commits mailing list