[Lldb-commits] [lldb] Default-initialize all fields of lldb_dap::protocol::Symbol. (PR #157150)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 5 10:59:08 PDT 2025


================
@@ -50,29 +50,29 @@ llvm::json::Value toJSON(const SourceLLDBData &);
 
 struct Symbol {
   /// The symbol id, usually the original symbol table index.
-  uint32_t id;
+  uint32_t id = 0;
 
   /// True if this symbol is debug information in a symbol.
-  bool isDebug;
+  bool isDebug = false;
 
   /// True if this symbol is not actually in the symbol table, but synthesized
   /// from other info in the object file.
-  bool isSynthetic;
+  bool isSynthetic = false;
 
   /// True if this symbol is globally visible.
-  bool isExternal;
+  bool isExternal = false;
 
   /// The symbol type.
-  lldb::SymbolType type;
+  lldb::SymbolType type = lldb::eSymbolTypeInvalid;
 
   /// The symbol file address.
-  lldb::addr_t fileAddress;
+  lldb::addr_t fileAddress = 0;
----------------
JDevlieghere wrote:

```suggestion
  lldb::addr_t fileAddress = LLDB_INVALID_ADDRESS;
```

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


More information about the lldb-commits mailing list