summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Target')
-rw-r--r--lldb/source/Target/StackFrame.cpp18
-rw-r--r--lldb/source/Target/Target.cpp5
2 files changed, 20 insertions, 3 deletions
diff --git a/lldb/source/Target/StackFrame.cpp b/lldb/source/Target/StackFrame.cpp
index eb86f465f10..633d394cf07 100644
--- a/lldb/source/Target/StackFrame.cpp
+++ b/lldb/source/Target/StackFrame.cpp
@@ -480,11 +480,13 @@ StackFrame::GetVariableList (bool get_file_globals)
}
ValueObjectSP
-StackFrame::GetValueForVariableExpressionPath (const char *var_expr_cstr, bool check_ptr_vs_member, Error &error)
+StackFrame::GetValueForVariableExpressionPath (const char *var_expr_cstr, uint32_t options, Error &error)
{
if (var_expr_cstr && var_expr_cstr[0])
{
+ const bool check_ptr_vs_member = (options & eExpressionPathOptionCheckPtrVsMember) != 0;
+ const bool no_fragile_ivar = (options & eExpressionPathOptionsNoFragileObjcIvar) != 0;
error.Clear();
bool deref = false;
bool address_of = false;
@@ -536,6 +538,20 @@ StackFrame::GetValueForVariableExpressionPath (const char *var_expr_cstr, bool c
if (var_path.size() >= 2 && var_path[1] != '>')
return ValueObjectSP();
+ if (no_fragile_ivar)
+ {
+ // Make sure we aren't trying to deref an objective
+ // C ivar if this is not allowed
+ const uint32_t pointer_type_flags = ClangASTContext::GetTypeInfo (valobj_sp->GetClangType(), NULL, NULL);
+ if ((pointer_type_flags & ClangASTContext::eTypeIsObjC) &&
+ (pointer_type_flags & ClangASTContext::eTypeIsPointer))
+ {
+ // This was an objective C object pointer and
+ // it was requested we skip any fragile ivars
+ // so return nothing here
+ return ValueObjectSP();
+ }
+ }
var_path.erase (0, 1); // Remove the '-'
// Fall through
case '.':
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index 9afd96fc987..3cd43e15909 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -923,8 +923,9 @@ Target::EvaluateExpression
{
frame->CalculateExecutionContext(exe_ctx);
Error error;
- const bool check_ptr_vs_member = true;
- result_valobj_sp = frame->GetValueForVariableExpressionPath (expr_cstr, check_ptr_vs_member, error);
+ const uint32_t expr_path_options = StackFrame::eExpressionPathOptionCheckPtrVsMember |
+ StackFrame::eExpressionPathOptionsNoFragileObjcIvar;
+ result_valobj_sp = frame->GetValueForVariableExpressionPath (expr_cstr, expr_path_options, error);
}
else if (m_process_sp)
{
OpenPOWER on IntegriCloud