Changeset View
Changeset View
Standalone View
Standalone View
lldb/source/Target/StackFrame.cpp
Show First 20 Lines • Show All 600 Lines • ▼ Show 20 Lines | ValueObjectSP StackFrame::GetValueForVariableExpressionPath( | ||||
} | } | ||||
if (!valobj_sp) { | if (!valobj_sp) { | ||||
error.SetErrorStringWithFormat("no variable named '%s' found in this frame", | error.SetErrorStringWithFormat("no variable named '%s' found in this frame", | ||||
name_const_string.GetCString()); | name_const_string.GetCString()); | ||||
return ValueObjectSP(); | return ValueObjectSP(); | ||||
} | } | ||||
// We are dumping at least one child | // We are dumping at least one child | ||||
while (separator_idx != std::string::npos) { | while (!var_expr.empty()) { | ||||
// Calculate the next separator index ahead of time | // Calculate the next separator index ahead of time | ||||
ValueObjectSP child_valobj_sp; | ValueObjectSP child_valobj_sp; | ||||
const char separator_type = var_expr[0]; | const char separator_type = var_expr[0]; | ||||
bool expr_is_ptr = false; | bool expr_is_ptr = false; | ||||
switch (separator_type) { | switch (separator_type) { | ||||
case '-': | case '-': | ||||
expr_is_ptr = true; | expr_is_ptr = true; | ||||
if (var_expr.size() >= 2 && var_expr[1] != '>') | if (var_expr.size() >= 2 && var_expr[1] != '>') | ||||
▲ Show 20 Lines • Show All 317 Lines • ▼ Show 20 Lines | case '[': { | ||||
} | } | ||||
} | } | ||||
if (!child_valobj_sp) { | if (!child_valobj_sp) { | ||||
// Invalid array index... | // Invalid array index... | ||||
return ValueObjectSP(); | return ValueObjectSP(); | ||||
} | } | ||||
separator_idx = var_expr.find_first_of(".-["); | |||||
if (use_dynamic != eNoDynamicValues) { | if (use_dynamic != eNoDynamicValues) { | ||||
ValueObjectSP dynamic_value_sp( | ValueObjectSP dynamic_value_sp( | ||||
child_valobj_sp->GetDynamicValue(use_dynamic)); | child_valobj_sp->GetDynamicValue(use_dynamic)); | ||||
if (dynamic_value_sp) | if (dynamic_value_sp) | ||||
child_valobj_sp = dynamic_value_sp; | child_valobj_sp = dynamic_value_sp; | ||||
} | } | ||||
// Break out early from the switch since we were able to find the child | // Break out early from the switch since we were able to find the child | ||||
// member | // member | ||||
▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | case '[': { | ||||
var_expr_path_strm.GetData()); | var_expr_path_strm.GetData()); | ||||
} | } | ||||
if (!child_valobj_sp) { | if (!child_valobj_sp) { | ||||
// Invalid bitfield range... | // Invalid bitfield range... | ||||
return ValueObjectSP(); | return ValueObjectSP(); | ||||
} | } | ||||
separator_idx = var_expr.find_first_of(".-["); | |||||
if (use_dynamic != eNoDynamicValues) { | if (use_dynamic != eNoDynamicValues) { | ||||
ValueObjectSP dynamic_value_sp( | ValueObjectSP dynamic_value_sp( | ||||
child_valobj_sp->GetDynamicValue(use_dynamic)); | child_valobj_sp->GetDynamicValue(use_dynamic)); | ||||
if (dynamic_value_sp) | if (dynamic_value_sp) | ||||
child_valobj_sp = dynamic_value_sp; | child_valobj_sp = dynamic_value_sp; | ||||
} | } | ||||
// Break out early from the switch since we were able to find the child | // Break out early from the switch since we were able to find the child | ||||
// member | // member | ||||
Show All 9 Lines | default: | ||||
var_expr.str().c_str()); | var_expr.str().c_str()); | ||||
return ValueObjectSP(); | return ValueObjectSP(); | ||||
} | } | ||||
} | } | ||||
if (child_valobj_sp) | if (child_valobj_sp) | ||||
valobj_sp = child_valobj_sp; | valobj_sp = child_valobj_sp; | ||||
if (var_expr.empty()) | |||||
break; | |||||
} | } | ||||
if (valobj_sp) { | if (valobj_sp) { | ||||
if (deref) { | if (deref) { | ||||
ValueObjectSP deref_valobj_sp(valobj_sp->Dereference(error)); | ValueObjectSP deref_valobj_sp(valobj_sp->Dereference(error)); | ||||
valobj_sp = deref_valobj_sp; | valobj_sp = deref_valobj_sp; | ||||
} else if (address_of) { | } else if (address_of) { | ||||
ValueObjectSP address_of_valobj_sp(valobj_sp->AddressOf(error)); | ValueObjectSP address_of_valobj_sp(valobj_sp->AddressOf(error)); | ||||
valobj_sp = address_of_valobj_sp; | valobj_sp = address_of_valobj_sp; | ||||
▲ Show 20 Lines • Show All 904 Lines • Show Last 20 Lines |