-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Bugfix: Not showing the synthetic children of values behind pointers #117755
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4020,6 +4020,10 @@ void request_variables(DAP &dap, const llvm::json::Object &request) { | |
| std::optional<std::string> custom_name = {}) { | ||
| if (!child.IsValid()) | ||
| return; | ||
| if (child.IsSynthetic() && (child.GetType().IsPointerType() || child.GetType().IsReferenceType())) { | ||
| // Dereference to access synthetic children behind pointers/references | ||
| child = child.Dereference(); | ||
| } | ||
| bool is_permanent = | ||
| dap.variables.IsPermanentVariableReference(variablesReference); | ||
| int64_t var_ref = dap.variables.InsertVariable(child, is_permanent); | ||
|
|
@@ -4028,6 +4032,9 @@ void request_variables(DAP &dap, const llvm::json::Object &request) { | |
| dap.enable_synthetic_child_debugging, | ||
| /*is_name_duplicated=*/false, custom_name)); | ||
| }; | ||
| if (variable.GetType().IsPointerType() || variable.GetType().IsReferenceType()) { | ||
| variable = variable.Dereference(); | ||
| } | ||
|
Comment on lines
+4035
to
+4037
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you know why you need this change and the one above is not enough?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The first change is more than enough. To be on the safe side, I overcomplicated it a little. I will remove the second change. |
||
| const int64_t num_children = variable.GetNumChildren(); | ||
| int64_t end_idx = start + ((count == 0) ? num_children : count); | ||
| int64_t i = start; | ||
|
|
||
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.
@clayborg , what do you think about this? This pretty much matches the experience from CLI, i.e. the variable name is prepended with
*, but the synthetic value is displayed right away.