[Lldb-commits] [lldb] [LLDB] Omit loading local symbols in LLDB symbol table (PR #154809)

David Peixotto via lldb-commits lldb-commits at lists.llvm.org
Tue Aug 26 09:59:08 PDT 2025


================
@@ -2235,6 +2259,27 @@ ObjectFileELF::ParseSymbols(Symtab *symtab, user_id_t start_id,
           if (mapping_symbol)
             continue;
         }
+      } else if (IsRISCVArch(arch.GetMachine())) {
+        if (symbol.getBinding() == STB_LOCAL) {
+          char mapping_symbol = FindRISCVMappingSymbol(symbol_name);
----------------
dmpots wrote:

I'm not sure the `FindRISCVMappingSymbol` is making the code cleaner here since we have to switch on the result anyway.

I think it would look cleaner to just check the symbol directly.

```
  if (strcmp(symbol_name, "$d") == 0) {
    address_class_map[symbol.st_value] = AddressClass::eCode;
    continue;
  }
  if (strcmp(symbol_name, "$x") == 0) {
    address_class_map[symbol.st_value] = AddressClass::eData;
    continue;
  }
```

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


More information about the lldb-commits mailing list