Author: lexi-nadia Date: 2025-09-05T13:51:49-07:00 New Revision: a652979b483da6e5a45ebf6428be408de66ac857
URL: https://github.com/llvm/llvm-project/commit/a652979b483da6e5a45ebf6428be408de66ac857 DIFF: https://github.com/llvm/llvm-project/commit/a652979b483da6e5a45ebf6428be408de66ac857.diff LOG: Default-initialize all fields of lldb_dap::protocol::Symbol. (#157150) Co-authored-by: Jonas Devlieghere <jo...@devlieghere.com> Added: Modified: lldb/tools/lldb-dap/Handler/ModuleSymbolsRequestHandler.cpp lldb/tools/lldb-dap/Protocol/DAPTypes.h Removed: ################################################################################ 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..23ba93946bdee 100644 --- a/lldb/tools/lldb-dap/Protocol/DAPTypes.h +++ b/lldb/tools/lldb-dap/Protocol/DAPTypes.h @@ -16,6 +16,7 @@ #ifndef LLDB_TOOLS_LLDB_DAP_PROTOCOL_DAP_TYPES_H #define LLDB_TOOLS_LLDB_DAP_PROTOCOL_DAP_TYPES_H +#include "lldb/lldb-defines.h" #include "lldb/lldb-types.h" #include "llvm/Support/JSON.h" #include <optional> @@ -50,29 +51,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 = LLDB_INVALID_ADDRESS; /// The symbol load address. std::optional<lldb::addr_t> loadAddress; /// The symbol size. - lldb::addr_t size; + lldb::addr_t size = 0; /// The symbol name. std::string name; _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits