This revision was automatically updated to reflect the committed changes.
Closed by commit rGe30c493894c4: [lldb] Support non-pointer implicit this/self
in… (authored by kastiglione).
Herald added a subscriber: Michael137.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D127605/new/
https://reviews.llvm.org/D127605
Files:
lldb/source/Target/StackFrame.cpp
Index: lldb/source/Target/StackFrame.cpp
===================================================================
--- lldb/source/Target/StackFrame.cpp
+++ lldb/source/Target/StackFrame.cpp
@@ -552,7 +552,7 @@
if (!var_sp && (options & eExpressionPathOptionsAllowDirectIVarAccess)) {
// Check for direct ivars access which helps us with implicit access to
- // ivars with the "this->" or "self->"
+ // ivars using "this" or "self".
GetSymbolContext(eSymbolContextFunction | eSymbolContextBlock);
lldb::LanguageType method_language = eLanguageTypeUnknown;
bool is_instance_method = false;
@@ -563,7 +563,13 @@
var_sp = variable_list->FindVariable(method_object_name);
if (var_sp) {
separator_idx = 0;
- var_expr_storage = "->";
+ if (Type *var_type = var_sp->GetType())
+ if (auto compiler_type = var_type->GetForwardCompilerType())
+ if (!compiler_type.IsPointerType())
+ var_expr_storage = ".";
+
+ if (var_expr_storage.empty())
+ var_expr_storage = "->";
var_expr_storage += var_expr;
var_expr = var_expr_storage;
synthetically_added_instance_object = true;
Index: lldb/source/Target/StackFrame.cpp
===================================================================
--- lldb/source/Target/StackFrame.cpp
+++ lldb/source/Target/StackFrame.cpp
@@ -552,7 +552,7 @@
if (!var_sp && (options & eExpressionPathOptionsAllowDirectIVarAccess)) {
// Check for direct ivars access which helps us with implicit access to
- // ivars with the "this->" or "self->"
+ // ivars using "this" or "self".
GetSymbolContext(eSymbolContextFunction | eSymbolContextBlock);
lldb::LanguageType method_language = eLanguageTypeUnknown;
bool is_instance_method = false;
@@ -563,7 +563,13 @@
var_sp = variable_list->FindVariable(method_object_name);
if (var_sp) {
separator_idx = 0;
- var_expr_storage = "->";
+ if (Type *var_type = var_sp->GetType())
+ if (auto compiler_type = var_type->GetForwardCompilerType())
+ if (!compiler_type.IsPointerType())
+ var_expr_storage = ".";
+
+ if (var_expr_storage.empty())
+ var_expr_storage = "->";
var_expr_storage += var_expr;
var_expr = var_expr_storage;
synthetically_added_instance_object = true;
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits