Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions lldb/tools/lldb-dap/lldb-dap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())) {
Copy link
Member

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.

// 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);
Expand All @@ -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
Copy link
Member

Choose a reason for hiding this comment

The 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?

Copy link
Author

@skuznetsov skuznetsov Nov 26, 2024

Choose a reason for hiding this comment

The 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;
Expand Down