Skip to content

Commit 088a1dd

Browse files
committed
Default-initialize all fields of lldb_dap::protocol::Symbol.
1 parent 07d0225 commit 088a1dd

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

lldb/tools/lldb-dap/Handler/ModuleSymbolsRequestHandler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ ModuleSymbolsRequestHandler::Run(const ModuleSymbolsArguments &args) const {
6060
if (!symbol.IsValid())
6161
continue;
6262

63-
Symbol dap_symbol = {};
63+
Symbol dap_symbol;
6464
dap_symbol.id = symbol.GetID();
6565
dap_symbol.type = symbol.GetType();
6666
dap_symbol.isDebug = symbol.IsDebug();

lldb/tools/lldb-dap/Protocol/DAPTypes.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,29 +50,29 @@ llvm::json::Value toJSON(const SourceLLDBData &);
5050

5151
struct Symbol {
5252
/// The symbol id, usually the original symbol table index.
53-
uint32_t id;
53+
uint32_t id = 0;
5454

5555
/// True if this symbol is debug information in a symbol.
56-
bool isDebug;
56+
bool isDebug = false;
5757

5858
/// True if this symbol is not actually in the symbol table, but synthesized
5959
/// from other info in the object file.
60-
bool isSynthetic;
60+
bool isSynthetic = false;
6161

6262
/// True if this symbol is globally visible.
63-
bool isExternal;
63+
bool isExternal = false;
6464

6565
/// The symbol type.
66-
lldb::SymbolType type;
66+
lldb::SymbolType type = lldb::eSymbolTypeInvalid;
6767

6868
/// The symbol file address.
69-
lldb::addr_t fileAddress;
69+
lldb::addr_t fileAddress = 0;
7070

7171
/// The symbol load address.
72-
std::optional<lldb::addr_t> loadAddress;
72+
std::optional<lldb::addr_t> loadAddress = std::nullopt;
7373

7474
/// The symbol size.
75-
lldb::addr_t size;
75+
lldb::addr_t size = 0;
7676

7777
/// The symbol name.
7878
std::string name;

0 commit comments

Comments
 (0)