[Lldb-commits] [lldb] Default-initialize all fields of lldb_dap::protocol::Symbol. (PR #157150)
via lldb-commits
lldb-commits at lists.llvm.org
Fri Sep 5 10:47:08 PDT 2025
https://github.com/lexi-nadia created https://github.com/llvm/llvm-project/pull/157150
None
>From 088a1dd896e7bbb27e4be3a59fd241928e0fccfd Mon Sep 17 00:00:00 2001
From: lexinadia <lexinadia at google.com>
Date: Fri, 5 Sep 2025 17:40:29 +0000
Subject: [PATCH] Default-initialize all fields of lldb_dap::protocol::Symbol.
---
.../Handler/ModuleSymbolsRequestHandler.cpp | 2 +-
lldb/tools/lldb-dap/Protocol/DAPTypes.h | 16 ++++++++--------
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/lldb/tools/lldb-dap/Handler/ModuleSymbolsRequestHandler.cpp b/lldb/tools/lldb-dap/Handler/ModuleSymbolsRequestHandler.cpp
index 4c61138e5007e..4a9d256cfa975 100644
--- a/lldb/tools/lldb-dap/Handler/ModuleSymbolsRequestHandler.cpp
+++ b/lldb/tools/lldb-dap/Handler/ModuleSymbolsRequestHandler.cpp
@@ -60,7 +60,7 @@ ModuleSymbolsRequestHandler::Run(const ModuleSymbolsArguments &args) const {
if (!symbol.IsValid())
continue;
- Symbol dap_symbol = {};
+ Symbol dap_symbol;
dap_symbol.id = symbol.GetID();
dap_symbol.type = symbol.GetType();
dap_symbol.isDebug = symbol.IsDebug();
diff --git a/lldb/tools/lldb-dap/Protocol/DAPTypes.h b/lldb/tools/lldb-dap/Protocol/DAPTypes.h
index 7fccf1359a737..17a25c092b8dd 100644
--- a/lldb/tools/lldb-dap/Protocol/DAPTypes.h
+++ b/lldb/tools/lldb-dap/Protocol/DAPTypes.h
@@ -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;
/// The symbol load address.
- std::optional<lldb::addr_t> loadAddress;
+ std::optional<lldb::addr_t> loadAddress = std::nullopt;
/// The symbol size.
- lldb::addr_t size;
+ lldb::addr_t size = 0;
/// The symbol name.
std::string name;
More information about the lldb-commits
mailing list