-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Default-initialize all fields of lldb_dap::protocol::Symbol. #157150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@llvm/pr-subscribers-lldb Author: None (lexi-nadia) ChangesFull diff: https://github.com/llvm/llvm-project/pull/157150.diff 2 Files Affected:
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;
|
JDevlieghere
reviewed
Sep 5, 2025
Co-authored-by: Jonas Devlieghere <[email protected]>
JDevlieghere
approved these changes
Sep 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
thanks! |
JDevlieghere
added a commit
to swiftlang/llvm-project
that referenced
this pull request
Oct 14, 2025
…7150) Co-authored-by: Jonas Devlieghere <[email protected]> (cherry picked from commit a652979)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.