Good catch, I'll fix it up later tonight <br><div class="gmail_quote"><div dir="ltr">On Wed, Nov 16, 2016 at 5:56 PM Jim Ingham <<a href="mailto:jingham@apple.com">jingham@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Probably just an oversight, but changing var_expr_cstr to a StringRef, but leaving it called "_cstr" will cause confusion.<br class="gmail_msg">
<br class="gmail_msg">
Jim<br class="gmail_msg">
<br class="gmail_msg">
> On Nov 16, 2016, at 5:37 PM, Zachary Turner via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org" class="gmail_msg" target="_blank">lldb-commits@lists.llvm.org</a>> wrote:<br class="gmail_msg">
><br class="gmail_msg">
> Author: zturner<br class="gmail_msg">
> Date: Wed Nov 16 19:37:52 2016<br class="gmail_msg">
> New Revision: 287189<br class="gmail_msg">
><br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=287189&view=rev" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project?rev=287189&view=rev</a><br class="gmail_msg">
> Log:<br class="gmail_msg">
> Make GetValueForVariableExpression use StringRef.<br class="gmail_msg">
><br class="gmail_msg">
> Also significantly reduced the indentation level by use of<br class="gmail_msg">
> early returns, and simplified some of the logic by using<br class="gmail_msg">
> StringRef functions such as consumeInteger() and getAsInteger()<br class="gmail_msg">
> instead of strtoll, etc.<br class="gmail_msg">
><br class="gmail_msg">
> Modified:<br class="gmail_msg">
> lldb/trunk/include/lldb/Target/StackFrame.h<br class="gmail_msg">
> lldb/trunk/source/Target/StackFrame.cpp<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/include/lldb/Target/StackFrame.h<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/StackFrame.h?rev=287189&r1=287188&r2=287189&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/StackFrame.h?rev=287189&r1=287188&r2=287189&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/include/lldb/Target/StackFrame.h (original)<br class="gmail_msg">
> +++ lldb/trunk/include/lldb/Target/StackFrame.h Wed Nov 16 19:37:52 2016<br class="gmail_msg">
> @@ -313,7 +313,7 @@ public:<br class="gmail_msg">
> /// A shared pointer to the ValueObject described by var_expr.<br class="gmail_msg">
> //------------------------------------------------------------------<br class="gmail_msg">
> lldb::ValueObjectSP GetValueForVariableExpressionPath(<br class="gmail_msg">
> - const char *var_expr, lldb::DynamicValueType use_dynamic,<br class="gmail_msg">
> + llvm::StringRef var_expr, lldb::DynamicValueType use_dynamic,<br class="gmail_msg">
> uint32_t options, lldb::VariableSP &var_sp, Error &error);<br class="gmail_msg">
><br class="gmail_msg">
> //------------------------------------------------------------------<br class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Target/StackFrame.cpp<br class="gmail_msg">
> URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrame.cpp?rev=287189&r1=287188&r2=287189&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrame.cpp?rev=287189&r1=287188&r2=287189&view=diff</a><br class="gmail_msg">
> ==============================================================================<br class="gmail_msg">
> --- lldb/trunk/source/Target/StackFrame.cpp (original)<br class="gmail_msg">
> +++ lldb/trunk/source/Target/StackFrame.cpp Wed Nov 16 19:37:52 2016<br class="gmail_msg">
> @@ -221,18 +221,17 @@ bool StackFrame::ChangePC(addr_t pc) {<br class="gmail_msg">
><br class="gmail_msg">
> const char *StackFrame::Disassemble() {<br class="gmail_msg">
> std::lock_guard<std::recursive_mutex> guard(m_mutex);<br class="gmail_msg">
> - if (m_disassembly.GetSize() == 0) {<br class="gmail_msg">
> - ExecutionContext exe_ctx(shared_from_this());<br class="gmail_msg">
> - Target *target = exe_ctx.GetTargetPtr();<br class="gmail_msg">
> - if (target) {<br class="gmail_msg">
> - const char *plugin_name = nullptr;<br class="gmail_msg">
> - const char *flavor = nullptr;<br class="gmail_msg">
> - Disassembler::Disassemble(target->GetDebugger(),<br class="gmail_msg">
> - target->GetArchitecture(), plugin_name, flavor,<br class="gmail_msg">
> - exe_ctx, 0, false, 0, 0, m_disassembly);<br class="gmail_msg">
> - }<br class="gmail_msg">
> - if (m_disassembly.GetSize() == 0)<br class="gmail_msg">
> - return nullptr;<br class="gmail_msg">
> + if (m_disassembly.Empty())<br class="gmail_msg">
> + return nullptr;<br class="gmail_msg">
> +<br class="gmail_msg">
> + ExecutionContext exe_ctx(shared_from_this());<br class="gmail_msg">
> + Target *target = exe_ctx.GetTargetPtr();<br class="gmail_msg">
> + if (target) {<br class="gmail_msg">
> + const char *plugin_name = nullptr;<br class="gmail_msg">
> + const char *flavor = nullptr;<br class="gmail_msg">
> + Disassembler::Disassemble(target->GetDebugger(), target->GetArchitecture(),<br class="gmail_msg">
> + plugin_name, flavor, exe_ctx, 0, false, 0, 0,<br class="gmail_msg">
> + m_disassembly);<br class="gmail_msg">
> }<br class="gmail_msg">
> return m_disassembly.GetData();<br class="gmail_msg">
> }<br class="gmail_msg">
> @@ -485,579 +484,557 @@ StackFrame::GetInScopeVariableList(bool<br class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> ValueObjectSP StackFrame::GetValueForVariableExpressionPath(<br class="gmail_msg">
> - const char *var_expr_cstr, DynamicValueType use_dynamic, uint32_t options,<br class="gmail_msg">
> - VariableSP &var_sp, Error &error) {<br class="gmail_msg">
> + llvm::StringRef var_expr_cstr, DynamicValueType use_dynamic,<br class="gmail_msg">
> + uint32_t options, VariableSP &var_sp, Error &error) {<br class="gmail_msg">
> // We can't fetch variable information for a history stack frame.<br class="gmail_msg">
> if (m_is_history_frame)<br class="gmail_msg">
> return ValueObjectSP();<br class="gmail_msg">
><br class="gmail_msg">
> - if (var_expr_cstr && var_expr_cstr[0]) {<br class="gmail_msg">
> - const bool check_ptr_vs_member =<br class="gmail_msg">
> - (options & eExpressionPathOptionCheckPtrVsMember) != 0;<br class="gmail_msg">
> - const bool no_fragile_ivar =<br class="gmail_msg">
> - (options & eExpressionPathOptionsNoFragileObjcIvar) != 0;<br class="gmail_msg">
> - const bool no_synth_child =<br class="gmail_msg">
> - (options & eExpressionPathOptionsNoSyntheticChildren) != 0;<br class="gmail_msg">
> - // const bool no_synth_array = (options &<br class="gmail_msg">
> - // eExpressionPathOptionsNoSyntheticArrayRange) != 0;<br class="gmail_msg">
> - error.Clear();<br class="gmail_msg">
> - bool deref = false;<br class="gmail_msg">
> - bool address_of = false;<br class="gmail_msg">
> - ValueObjectSP valobj_sp;<br class="gmail_msg">
> - const bool get_file_globals = true;<br class="gmail_msg">
> - // When looking up a variable for an expression, we need only consider the<br class="gmail_msg">
> - // variables that are in scope.<br class="gmail_msg">
> - VariableListSP var_list_sp(GetInScopeVariableList(get_file_globals));<br class="gmail_msg">
> - VariableList *variable_list = var_list_sp.get();<br class="gmail_msg">
> -<br class="gmail_msg">
> - if (variable_list) {<br class="gmail_msg">
> - // If first character is a '*', then show pointer contents<br class="gmail_msg">
> - const char *var_expr = var_expr_cstr;<br class="gmail_msg">
> - if (var_expr[0] == '*') {<br class="gmail_msg">
> - deref = true;<br class="gmail_msg">
> - var_expr++; // Skip the '*'<br class="gmail_msg">
> - } else if (var_expr[0] == '&') {<br class="gmail_msg">
> - address_of = true;<br class="gmail_msg">
> - var_expr++; // Skip the '&'<br class="gmail_msg">
> - }<br class="gmail_msg">
> -<br class="gmail_msg">
> - std::string var_path(var_expr);<br class="gmail_msg">
> - size_t separator_idx = var_path.find_first_of(".-[=+~|&^%#@!/?,<>{}");<br class="gmail_msg">
> - StreamString var_expr_path_strm;<br class="gmail_msg">
> -<br class="gmail_msg">
> - ConstString name_const_string;<br class="gmail_msg">
> - if (separator_idx == std::string::npos)<br class="gmail_msg">
> - name_const_string.SetCString(var_path.c_str());<br class="gmail_msg">
> - else<br class="gmail_msg">
> - name_const_string.SetCStringWithLength(var_path.c_str(), separator_idx);<br class="gmail_msg">
> + if (var_expr_cstr.empty()) {<br class="gmail_msg">
> + error.SetErrorStringWithFormat("invalid variable path '%s'", var_expr_cstr);<br class="gmail_msg">
> + return ValueObjectSP();<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + const bool check_ptr_vs_member =<br class="gmail_msg">
> + (options & eExpressionPathOptionCheckPtrVsMember) != 0;<br class="gmail_msg">
> + const bool no_fragile_ivar =<br class="gmail_msg">
> + (options & eExpressionPathOptionsNoFragileObjcIvar) != 0;<br class="gmail_msg">
> + const bool no_synth_child =<br class="gmail_msg">
> + (options & eExpressionPathOptionsNoSyntheticChildren) != 0;<br class="gmail_msg">
> + // const bool no_synth_array = (options &<br class="gmail_msg">
> + // eExpressionPathOptionsNoSyntheticArrayRange) != 0;<br class="gmail_msg">
> + error.Clear();<br class="gmail_msg">
> + bool deref = false;<br class="gmail_msg">
> + bool address_of = false;<br class="gmail_msg">
> + ValueObjectSP valobj_sp;<br class="gmail_msg">
> + const bool get_file_globals = true;<br class="gmail_msg">
> + // When looking up a variable for an expression, we need only consider the<br class="gmail_msg">
> + // variables that are in scope.<br class="gmail_msg">
> + VariableListSP var_list_sp(GetInScopeVariableList(get_file_globals));<br class="gmail_msg">
> + VariableList *variable_list = var_list_sp.get();<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (!variable_list)<br class="gmail_msg">
> + return ValueObjectSP();<br class="gmail_msg">
> +<br class="gmail_msg">
> + // If first character is a '*', then show pointer contents<br class="gmail_msg">
> + llvm::StringRef var_expr = var_expr_cstr;<br class="gmail_msg">
> + std::string var_expr_storage;<br class="gmail_msg">
> + if (var_expr[0] == '*') {<br class="gmail_msg">
> + deref = true;<br class="gmail_msg">
> + var_expr = var_expr.drop_front(); // Skip the '*'<br class="gmail_msg">
> + } else if (var_expr[0] == '&') {<br class="gmail_msg">
> + address_of = true;<br class="gmail_msg">
> + var_expr = var_expr.drop_front(); // Skip the '&'<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + size_t separator_idx = var_expr.find_first_of(".-[=+~|&^%#@!/?,<>{}");<br class="gmail_msg">
> + StreamString var_expr_path_strm;<br class="gmail_msg">
><br class="gmail_msg">
> - var_sp = variable_list->FindVariable(name_const_string, false);<br class="gmail_msg">
> + ConstString name_const_string(var_expr.substr(0, separator_idx));<br class="gmail_msg">
><br class="gmail_msg">
> - bool synthetically_added_instance_object = false;<br class="gmail_msg">
> + var_sp = variable_list->FindVariable(name_const_string, false);<br class="gmail_msg">
><br class="gmail_msg">
> - if (var_sp) {<br class="gmail_msg">
> - var_path.erase(0, name_const_string.GetLength());<br class="gmail_msg">
> + bool synthetically_added_instance_object = false;<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (var_sp) {<br class="gmail_msg">
> + var_expr = var_expr.drop_front(name_const_string.GetLength());<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (!var_sp && (options & eExpressionPathOptionsAllowDirectIVarAccess)) {<br class="gmail_msg">
> + // Check for direct ivars access which helps us with implicit<br class="gmail_msg">
> + // access to ivars with the "this->" or "self->"<br class="gmail_msg">
> + GetSymbolContext(eSymbolContextFunction | eSymbolContextBlock);<br class="gmail_msg">
> + lldb::LanguageType method_language = eLanguageTypeUnknown;<br class="gmail_msg">
> + bool is_instance_method = false;<br class="gmail_msg">
> + ConstString method_object_name;<br class="gmail_msg">
> + if (m_sc.GetFunctionMethodInfo(method_language, is_instance_method,<br class="gmail_msg">
> + method_object_name)) {<br class="gmail_msg">
> + if (is_instance_method && method_object_name) {<br class="gmail_msg">
> + var_sp = variable_list->FindVariable(method_object_name);<br class="gmail_msg">
> + if (var_sp) {<br class="gmail_msg">
> + separator_idx = 0;<br class="gmail_msg">
> + var_expr_storage = "->";<br class="gmail_msg">
> + var_expr_storage += var_expr;<br class="gmail_msg">
> + var_expr = var_expr_storage;<br class="gmail_msg">
> + synthetically_added_instance_object = true;<br class="gmail_msg">
> + }<br class="gmail_msg">
> }<br class="gmail_msg">
> + }<br class="gmail_msg">
> + }<br class="gmail_msg">
><br class="gmail_msg">
> - if (!var_sp && (options & eExpressionPathOptionsAllowDirectIVarAccess)) {<br class="gmail_msg">
> - // Check for direct ivars access which helps us with implicit<br class="gmail_msg">
> - // access to ivars with the "this->" or "self->"<br class="gmail_msg">
> - GetSymbolContext(eSymbolContextFunction | eSymbolContextBlock);<br class="gmail_msg">
> - lldb::LanguageType method_language = eLanguageTypeUnknown;<br class="gmail_msg">
> - bool is_instance_method = false;<br class="gmail_msg">
> - ConstString method_object_name;<br class="gmail_msg">
> - if (m_sc.GetFunctionMethodInfo(method_language, is_instance_method,<br class="gmail_msg">
> - method_object_name)) {<br class="gmail_msg">
> - if (is_instance_method && method_object_name) {<br class="gmail_msg">
> - var_sp = variable_list->FindVariable(method_object_name);<br class="gmail_msg">
> - if (var_sp) {<br class="gmail_msg">
> - separator_idx = 0;<br class="gmail_msg">
> - var_path.insert(0, "->");<br class="gmail_msg">
> - synthetically_added_instance_object = true;<br class="gmail_msg">
> - }<br class="gmail_msg">
> - }<br class="gmail_msg">
> + if (!var_sp && (options & eExpressionPathOptionsInspectAnonymousUnions)) {<br class="gmail_msg">
> + // Check if any anonymous unions are there which contain a variable with<br class="gmail_msg">
> + // the name we need<br class="gmail_msg">
> + for (size_t i = 0; i < variable_list->GetSize(); i++) {<br class="gmail_msg">
> + VariableSP variable_sp = variable_list->GetVariableAtIndex(i);<br class="gmail_msg">
> + if (!variable_sp)<br class="gmail_msg">
> + continue;<br class="gmail_msg">
> + if (!variable_sp->GetName().IsEmpty())<br class="gmail_msg">
> + continue;<br class="gmail_msg">
> +<br class="gmail_msg">
> + Type *var_type = variable_sp->GetType();<br class="gmail_msg">
> + if (!var_type)<br class="gmail_msg">
> + continue;<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (!var_type->GetForwardCompilerType().IsAnonymousType())<br class="gmail_msg">
> + continue;<br class="gmail_msg">
> + valobj_sp = GetValueObjectForFrameVariable(variable_sp, use_dynamic);<br class="gmail_msg">
> + if (!valobj_sp)<br class="gmail_msg">
> + return valobj_sp;<br class="gmail_msg">
> + valobj_sp = valobj_sp->GetChildMemberWithName(name_const_string, true);<br class="gmail_msg">
> + if (valobj_sp)<br class="gmail_msg">
> + break;<br class="gmail_msg">
> + }<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (var_sp && !valobj_sp) {<br class="gmail_msg">
> + valobj_sp = GetValueObjectForFrameVariable(var_sp, use_dynamic);<br class="gmail_msg">
> + if (!valobj_sp)<br class="gmail_msg">
> + return valobj_sp;<br class="gmail_msg">
> + }<br class="gmail_msg">
> + if (!valobj_sp) {<br class="gmail_msg">
> + error.SetErrorStringWithFormat("no variable named '%s' found in this frame",<br class="gmail_msg">
> + name_const_string.GetCString());<br class="gmail_msg">
> + return ValueObjectSP();<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + // We are dumping at least one child<br class="gmail_msg">
> + while (separator_idx != std::string::npos) {<br class="gmail_msg">
> + // Calculate the next separator index ahead of time<br class="gmail_msg">
> + ValueObjectSP child_valobj_sp;<br class="gmail_msg">
> + const char separator_type = var_expr[0];<br class="gmail_msg">
> + switch (separator_type) {<br class="gmail_msg">
> + case '-':<br class="gmail_msg">
> + if (var_expr.size() >= 2 && var_expr[1] != '>')<br class="gmail_msg">
> + return ValueObjectSP();<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (no_fragile_ivar) {<br class="gmail_msg">
> + // Make sure we aren't trying to deref an objective<br class="gmail_msg">
> + // C ivar if this is not allowed<br class="gmail_msg">
> + const uint32_t pointer_type_flags =<br class="gmail_msg">
> + valobj_sp->GetCompilerType().GetTypeInfo(nullptr);<br class="gmail_msg">
> + if ((pointer_type_flags & eTypeIsObjC) &&<br class="gmail_msg">
> + (pointer_type_flags & eTypeIsPointer)) {<br class="gmail_msg">
> + // This was an objective C object pointer and<br class="gmail_msg">
> + // it was requested we skip any fragile ivars<br class="gmail_msg">
> + // so return nothing here<br class="gmail_msg">
> + return ValueObjectSP();<br class="gmail_msg">
> + }<br class="gmail_msg">
> + }<br class="gmail_msg">
> + var_expr = var_expr.drop_front(); // Remove the '-'<br class="gmail_msg">
> + LLVM_FALLTHROUGH;<br class="gmail_msg">
> + case '.': {<br class="gmail_msg">
> + const bool expr_is_ptr = var_expr[0] == '>';<br class="gmail_msg">
> +<br class="gmail_msg">
> + var_expr = var_expr.drop_front(); // Remove the '.' or '>'<br class="gmail_msg">
> + separator_idx = var_expr.find_first_of(".-[");<br class="gmail_msg">
> + ConstString child_name(var_expr.substr(0, var_expr.find_first_of(".-[")));<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (check_ptr_vs_member) {<br class="gmail_msg">
> + // We either have a pointer type and need to verify<br class="gmail_msg">
> + // valobj_sp is a pointer, or we have a member of a<br class="gmail_msg">
> + // class/union/struct being accessed with the . syntax<br class="gmail_msg">
> + // and need to verify we don't have a pointer.<br class="gmail_msg">
> + const bool actual_is_ptr = valobj_sp->IsPointerType();<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (actual_is_ptr != expr_is_ptr) {<br class="gmail_msg">
> + // Incorrect use of "." with a pointer, or "->" with<br class="gmail_msg">
> + // a class/union/struct instance or reference.<br class="gmail_msg">
> + valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> + if (actual_is_ptr)<br class="gmail_msg">
> + error.SetErrorStringWithFormat(<br class="gmail_msg">
> + "\"%s\" is a pointer and . was used to attempt to access "<br class="gmail_msg">
> + "\"%s\". Did you mean \"%s->%s\"?",<br class="gmail_msg">
> + var_expr_path_strm.GetData(), child_name.GetCString(),<br class="gmail_msg">
> + var_expr_path_strm.GetData(), var_expr.str().c_str());<br class="gmail_msg">
> + else<br class="gmail_msg">
> + error.SetErrorStringWithFormat(<br class="gmail_msg">
> + "\"%s\" is not a pointer and -> was used to attempt to "<br class="gmail_msg">
> + "access \"%s\". Did you mean \"%s.%s\"?",<br class="gmail_msg">
> + var_expr_path_strm.GetData(), child_name.GetCString(),<br class="gmail_msg">
> + var_expr_path_strm.GetData(), var_expr.str().c_str());<br class="gmail_msg">
> + return ValueObjectSP();<br class="gmail_msg">
> }<br class="gmail_msg">
> }<br class="gmail_msg">
> + child_valobj_sp = valobj_sp->GetChildMemberWithName(child_name, true);<br class="gmail_msg">
> + if (!child_valobj_sp) {<br class="gmail_msg">
> + if (!no_synth_child) {<br class="gmail_msg">
> + child_valobj_sp = valobj_sp->GetSyntheticValue();<br class="gmail_msg">
> + if (child_valobj_sp)<br class="gmail_msg">
> + child_valobj_sp =<br class="gmail_msg">
> + child_valobj_sp->GetChildMemberWithName(child_name, true);<br class="gmail_msg">
> + }<br class="gmail_msg">
><br class="gmail_msg">
> - if (!var_sp && (options & eExpressionPathOptionsInspectAnonymousUnions)) {<br class="gmail_msg">
> - // Check if any anonymous unions are there which contain a variable with<br class="gmail_msg">
> - // the name we need<br class="gmail_msg">
> - for (size_t i = 0; i < variable_list->GetSize(); i++) {<br class="gmail_msg">
> - if (VariableSP variable_sp = variable_list->GetVariableAtIndex(i)) {<br class="gmail_msg">
> - if (variable_sp->GetName().IsEmpty()) {<br class="gmail_msg">
> - if (Type *var_type = variable_sp->GetType()) {<br class="gmail_msg">
> - if (var_type->GetForwardCompilerType().IsAnonymousType()) {<br class="gmail_msg">
> - valobj_sp =<br class="gmail_msg">
> - GetValueObjectForFrameVariable(variable_sp, use_dynamic);<br class="gmail_msg">
> - if (!valobj_sp)<br class="gmail_msg">
> - return valobj_sp;<br class="gmail_msg">
> - valobj_sp = valobj_sp->GetChildMemberWithName(<br class="gmail_msg">
> - name_const_string, true);<br class="gmail_msg">
> - if (valobj_sp)<br class="gmail_msg">
> - break;<br class="gmail_msg">
> - }<br class="gmail_msg">
> - }<br class="gmail_msg">
> + if (no_synth_child || !child_valobj_sp) {<br class="gmail_msg">
> + // No child member with name "child_name"<br class="gmail_msg">
> + if (synthetically_added_instance_object) {<br class="gmail_msg">
> + // We added a "this->" or "self->" to the beginning of the<br class="gmail_msg">
> + // expression<br class="gmail_msg">
> + // and this is the first pointer ivar access, so just return<br class="gmail_msg">
> + // the normal<br class="gmail_msg">
> + // error<br class="gmail_msg">
> + error.SetErrorStringWithFormat(<br class="gmail_msg">
> + "no variable or instance variable named '%s' found in "<br class="gmail_msg">
> + "this frame",<br class="gmail_msg">
> + name_const_string.GetCString());<br class="gmail_msg">
> + } else {<br class="gmail_msg">
> + valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> + if (child_name) {<br class="gmail_msg">
> + error.SetErrorStringWithFormat(<br class="gmail_msg">
> + "\"%s\" is not a member of \"(%s) %s\"",<br class="gmail_msg">
> + child_name.GetCString(),<br class="gmail_msg">
> + valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> + var_expr_path_strm.GetData());<br class="gmail_msg">
> + } else {<br class="gmail_msg">
> + error.SetErrorStringWithFormat(<br class="gmail_msg">
> + "incomplete expression path after \"%s\" in \"%s\"",<br class="gmail_msg">
> + var_expr_path_strm.GetData(), var_expr_cstr);<br class="gmail_msg">
> }<br class="gmail_msg">
> }<br class="gmail_msg">
> + return ValueObjectSP();<br class="gmail_msg">
> }<br class="gmail_msg">
> }<br class="gmail_msg">
> + synthetically_added_instance_object = false;<br class="gmail_msg">
> + // Remove the child name from the path<br class="gmail_msg">
> + var_expr = var_expr.drop_front(child_name.GetLength());<br class="gmail_msg">
> + if (use_dynamic != eNoDynamicValues) {<br class="gmail_msg">
> + ValueObjectSP dynamic_value_sp(<br class="gmail_msg">
> + child_valobj_sp->GetDynamicValue(use_dynamic));<br class="gmail_msg">
> + if (dynamic_value_sp)<br class="gmail_msg">
> + child_valobj_sp = dynamic_value_sp;<br class="gmail_msg">
> + }<br class="gmail_msg">
> + } break;<br class="gmail_msg">
> +<br class="gmail_msg">
> + case '[': {<br class="gmail_msg">
> + // Array member access, or treating pointer as an array<br class="gmail_msg">
> + // Need at least two brackets and a number<br class="gmail_msg">
> + if (var_expr.size() <= 2) {<br class="gmail_msg">
> + error.SetErrorStringWithFormat(<br class="gmail_msg">
> + "invalid square bracket encountered after \"%s\" in \"%s\"",<br class="gmail_msg">
> + var_expr_path_strm.GetData(), var_expr.str().c_str());<br class="gmail_msg">
> + return ValueObjectSP();<br class="gmail_msg">
> + }<br class="gmail_msg">
><br class="gmail_msg">
> - if (var_sp && !valobj_sp) {<br class="gmail_msg">
> - valobj_sp = GetValueObjectForFrameVariable(var_sp, use_dynamic);<br class="gmail_msg">
> - if (!valobj_sp)<br class="gmail_msg">
> - return valobj_sp;<br class="gmail_msg">
> - }<br class="gmail_msg">
> - if (valobj_sp) {<br class="gmail_msg">
> - // We are dumping at least one child<br class="gmail_msg">
> - while (separator_idx != std::string::npos) {<br class="gmail_msg">
> - // Calculate the next separator index ahead of time<br class="gmail_msg">
> - ValueObjectSP child_valobj_sp;<br class="gmail_msg">
> - const char separator_type = var_path[0];<br class="gmail_msg">
> - switch (separator_type) {<br class="gmail_msg">
> - case '-':<br class="gmail_msg">
> - if (var_path.size() >= 2 && var_path[1] != '>')<br class="gmail_msg">
> - return ValueObjectSP();<br class="gmail_msg">
> -<br class="gmail_msg">
> - if (no_fragile_ivar) {<br class="gmail_msg">
> - // Make sure we aren't trying to deref an objective<br class="gmail_msg">
> - // C ivar if this is not allowed<br class="gmail_msg">
> - const uint32_t pointer_type_flags =<br class="gmail_msg">
> - valobj_sp->GetCompilerType().GetTypeInfo(nullptr);<br class="gmail_msg">
> - if ((pointer_type_flags & eTypeIsObjC) &&<br class="gmail_msg">
> - (pointer_type_flags & eTypeIsPointer)) {<br class="gmail_msg">
> - // This was an objective C object pointer and<br class="gmail_msg">
> - // it was requested we skip any fragile ivars<br class="gmail_msg">
> - // so return nothing here<br class="gmail_msg">
> - return ValueObjectSP();<br class="gmail_msg">
> - }<br class="gmail_msg">
> - }<br class="gmail_msg">
> - var_path.erase(0, 1); // Remove the '-'<br class="gmail_msg">
> - LLVM_FALLTHROUGH;<br class="gmail_msg">
> - case '.': {<br class="gmail_msg">
> - const bool expr_is_ptr = var_path[0] == '>';<br class="gmail_msg">
> -<br class="gmail_msg">
> - var_path.erase(0, 1); // Remove the '.' or '>'<br class="gmail_msg">
> - separator_idx = var_path.find_first_of(".-[");<br class="gmail_msg">
> - ConstString child_name;<br class="gmail_msg">
> - if (separator_idx == std::string::npos)<br class="gmail_msg">
> - child_name.SetCString(var_path.c_str());<br class="gmail_msg">
> - else<br class="gmail_msg">
> - child_name.SetCStringWithLength(var_path.c_str(), separator_idx);<br class="gmail_msg">
> -<br class="gmail_msg">
> - if (check_ptr_vs_member) {<br class="gmail_msg">
> - // We either have a pointer type and need to verify<br class="gmail_msg">
> - // valobj_sp is a pointer, or we have a member of a<br class="gmail_msg">
> - // class/union/struct being accessed with the . syntax<br class="gmail_msg">
> - // and need to verify we don't have a pointer.<br class="gmail_msg">
> - const bool actual_is_ptr = valobj_sp->IsPointerType();<br class="gmail_msg">
> -<br class="gmail_msg">
> - if (actual_is_ptr != expr_is_ptr) {<br class="gmail_msg">
> - // Incorrect use of "." with a pointer, or "->" with<br class="gmail_msg">
> - // a class/union/struct instance or reference.<br class="gmail_msg">
> + // Drop the open brace.<br class="gmail_msg">
> + var_expr = var_expr.drop_front();<br class="gmail_msg">
> + long child_index = 0;<br class="gmail_msg">
> +<br class="gmail_msg">
> + // If there's no closing brace, this is an invalid expression.<br class="gmail_msg">
> + size_t end_pos = var_expr.find_first_of(']');<br class="gmail_msg">
> + if (end_pos == llvm::StringRef::npos) {<br class="gmail_msg">
> + error.SetErrorStringWithFormat(<br class="gmail_msg">
> + "missing closing square bracket in expression \"%s\"",<br class="gmail_msg">
> + var_expr_path_strm.GetData());<br class="gmail_msg">
> + return ValueObjectSP();<br class="gmail_msg">
> + }<br class="gmail_msg">
> + llvm::StringRef index_expr = var_expr.take_front(end_pos);<br class="gmail_msg">
> + llvm::StringRef original_index_expr = index_expr;<br class="gmail_msg">
> + // Drop all of "[index_expr]"<br class="gmail_msg">
> + var_expr = var_expr.drop_front(end_pos + 1);<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (index_expr.consumeInteger(0, child_index)) {<br class="gmail_msg">
> + // If there was no integer anywhere in the index expression, this is<br class="gmail_msg">
> + // erroneous expression.<br class="gmail_msg">
> + error.SetErrorStringWithFormat("invalid index expression \"%s\"",<br class="gmail_msg">
> + index_expr.str().c_str());<br class="gmail_msg">
> + return ValueObjectSP();<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (index_expr.empty()) {<br class="gmail_msg">
> + // The entire index expression was a single integer.<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (valobj_sp->GetCompilerType().IsPointerToScalarType() && deref) {<br class="gmail_msg">
> + // what we have is *ptr[low]. the most similar C++ syntax is to deref<br class="gmail_msg">
> + // ptr and extract bit low out of it. reading array item low would be<br class="gmail_msg">
> + // done by saying ptr[low], without a deref * sign<br class="gmail_msg">
> + Error error;<br class="gmail_msg">
> + ValueObjectSP temp(valobj_sp->Dereference(error));<br class="gmail_msg">
> + if (error.Fail()) {<br class="gmail_msg">
> + valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> + error.SetErrorStringWithFormat(<br class="gmail_msg">
> + "could not dereference \"(%s) %s\"",<br class="gmail_msg">
> + valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> + var_expr_path_strm.GetData());<br class="gmail_msg">
> + return ValueObjectSP();<br class="gmail_msg">
> + }<br class="gmail_msg">
> + valobj_sp = temp;<br class="gmail_msg">
> + deref = false;<br class="gmail_msg">
> + } else if (valobj_sp->GetCompilerType().IsArrayOfScalarType() &&<br class="gmail_msg">
> + deref) {<br class="gmail_msg">
> + // what we have is *arr[low]. the most similar C++ syntax is<br class="gmail_msg">
> + // to get arr[0]<br class="gmail_msg">
> + // (an operation that is equivalent to deref-ing arr)<br class="gmail_msg">
> + // and extract bit low out of it. reading array item low<br class="gmail_msg">
> + // would be done by saying arr[low], without a deref * sign<br class="gmail_msg">
> + Error error;<br class="gmail_msg">
> + ValueObjectSP temp(valobj_sp->GetChildAtIndex(0, true));<br class="gmail_msg">
> + if (error.Fail()) {<br class="gmail_msg">
> + valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> + error.SetErrorStringWithFormat(<br class="gmail_msg">
> + "could not get item 0 for \"(%s) %s\"",<br class="gmail_msg">
> + valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> + var_expr_path_strm.GetData());<br class="gmail_msg">
> + return ValueObjectSP();<br class="gmail_msg">
> + }<br class="gmail_msg">
> + valobj_sp = temp;<br class="gmail_msg">
> + deref = false;<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + bool is_incomplete_array = false;<br class="gmail_msg">
> + if (valobj_sp->IsPointerType()) {<br class="gmail_msg">
> + bool is_objc_pointer = true;<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (valobj_sp->GetCompilerType().GetMinimumLanguage() !=<br class="gmail_msg">
> + eLanguageTypeObjC)<br class="gmail_msg">
> + is_objc_pointer = false;<br class="gmail_msg">
> + else if (!valobj_sp->GetCompilerType().IsPointerType())<br class="gmail_msg">
> + is_objc_pointer = false;<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (no_synth_child && is_objc_pointer) {<br class="gmail_msg">
> + error.SetErrorStringWithFormat(<br class="gmail_msg">
> + "\"(%s) %s\" is an Objective-C pointer, and cannot be "<br class="gmail_msg">
> + "subscripted",<br class="gmail_msg">
> + valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> + var_expr_path_strm.GetData());<br class="gmail_msg">
> +<br class="gmail_msg">
> + return ValueObjectSP();<br class="gmail_msg">
> + } else if (is_objc_pointer) {<br class="gmail_msg">
> + // dereferencing ObjC variables is not valid.. so let's try<br class="gmail_msg">
> + // and recur to synthetic children<br class="gmail_msg">
> + ValueObjectSP synthetic = valobj_sp->GetSyntheticValue();<br class="gmail_msg">
> + if (!synthetic /* no synthetic */<br class="gmail_msg">
> + || synthetic == valobj_sp) /* synthetic is the same as<br class="gmail_msg">
> + the original object */<br class="gmail_msg">
> + {<br class="gmail_msg">
> + valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> + error.SetErrorStringWithFormat(<br class="gmail_msg">
> + "\"(%s) %s\" is not an array type",<br class="gmail_msg">
> + valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> + var_expr_path_strm.GetData());<br class="gmail_msg">
> + } else if (<br class="gmail_msg">
> + static_cast<uint32_t>(child_index) >=<br class="gmail_msg">
> + synthetic<br class="gmail_msg">
> + ->GetNumChildren() /* synthetic does not have that many values */) {<br class="gmail_msg">
> + valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> + error.SetErrorStringWithFormat(<br class="gmail_msg">
> + "array index %ld is not valid for \"(%s) %s\"", child_index,<br class="gmail_msg">
> + valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> + var_expr_path_strm.GetData());<br class="gmail_msg">
> + } else {<br class="gmail_msg">
> + child_valobj_sp = synthetic->GetChildAtIndex(child_index, true);<br class="gmail_msg">
> + if (!child_valobj_sp) {<br class="gmail_msg">
> valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> - if (actual_is_ptr)<br class="gmail_msg">
> - error.SetErrorStringWithFormat(<br class="gmail_msg">
> - "\"%s\" is a pointer and . was used to attempt to access "<br class="gmail_msg">
> - "\"%s\". Did you mean \"%s->%s\"?",<br class="gmail_msg">
> - var_expr_path_strm.GetData(), child_name.GetCString(),<br class="gmail_msg">
> - var_expr_path_strm.GetData(), var_path.c_str());<br class="gmail_msg">
> - else<br class="gmail_msg">
> - error.SetErrorStringWithFormat(<br class="gmail_msg">
> - "\"%s\" is not a pointer and -> was used to attempt to "<br class="gmail_msg">
> - "access \"%s\". Did you mean \"%s.%s\"?",<br class="gmail_msg">
> - var_expr_path_strm.GetData(), child_name.GetCString(),<br class="gmail_msg">
> - var_expr_path_strm.GetData(), var_path.c_str());<br class="gmail_msg">
> - return ValueObjectSP();<br class="gmail_msg">
> + error.SetErrorStringWithFormat(<br class="gmail_msg">
> + "array index %ld is not valid for \"(%s) %s\"", child_index,<br class="gmail_msg">
> + valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> + var_expr_path_strm.GetData());<br class="gmail_msg">
> }<br class="gmail_msg">
> }<br class="gmail_msg">
> + } else {<br class="gmail_msg">
> child_valobj_sp =<br class="gmail_msg">
> - valobj_sp->GetChildMemberWithName(child_name, true);<br class="gmail_msg">
> + valobj_sp->GetSyntheticArrayMember(child_index, true);<br class="gmail_msg">
> if (!child_valobj_sp) {<br class="gmail_msg">
> - if (!no_synth_child) {<br class="gmail_msg">
> - child_valobj_sp = valobj_sp->GetSyntheticValue();<br class="gmail_msg">
> - if (child_valobj_sp)<br class="gmail_msg">
> - child_valobj_sp =<br class="gmail_msg">
> - child_valobj_sp->GetChildMemberWithName(child_name, true);<br class="gmail_msg">
> - }<br class="gmail_msg">
> -<br class="gmail_msg">
> - if (no_synth_child || !child_valobj_sp) {<br class="gmail_msg">
> - // No child member with name "child_name"<br class="gmail_msg">
> - if (synthetically_added_instance_object) {<br class="gmail_msg">
> - // We added a "this->" or "self->" to the beginning of the<br class="gmail_msg">
> - // expression<br class="gmail_msg">
> - // and this is the first pointer ivar access, so just return<br class="gmail_msg">
> - // the normal<br class="gmail_msg">
> - // error<br class="gmail_msg">
> - error.SetErrorStringWithFormat(<br class="gmail_msg">
> - "no variable or instance variable named '%s' found in "<br class="gmail_msg">
> - "this frame",<br class="gmail_msg">
> - name_const_string.GetCString());<br class="gmail_msg">
> - } else {<br class="gmail_msg">
> - valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> - if (child_name) {<br class="gmail_msg">
> - error.SetErrorStringWithFormat(<br class="gmail_msg">
> - "\"%s\" is not a member of \"(%s) %s\"",<br class="gmail_msg">
> - child_name.GetCString(),<br class="gmail_msg">
> - valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> - var_expr_path_strm.GetData());<br class="gmail_msg">
> - } else {<br class="gmail_msg">
> - error.SetErrorStringWithFormat(<br class="gmail_msg">
> - "incomplete expression path after \"%s\" in \"%s\"",<br class="gmail_msg">
> - var_expr_path_strm.GetData(), var_expr_cstr);<br class="gmail_msg">
> - }<br class="gmail_msg">
> - }<br class="gmail_msg">
> - return ValueObjectSP();<br class="gmail_msg">
> - }<br class="gmail_msg">
> - }<br class="gmail_msg">
> - synthetically_added_instance_object = false;<br class="gmail_msg">
> - // Remove the child name from the path<br class="gmail_msg">
> - var_path.erase(0, child_name.GetLength());<br class="gmail_msg">
> - if (use_dynamic != eNoDynamicValues) {<br class="gmail_msg">
> - ValueObjectSP dynamic_value_sp(<br class="gmail_msg">
> - child_valobj_sp->GetDynamicValue(use_dynamic));<br class="gmail_msg">
> - if (dynamic_value_sp)<br class="gmail_msg">
> - child_valobj_sp = dynamic_value_sp;<br class="gmail_msg">
> - }<br class="gmail_msg">
> - } break;<br class="gmail_msg">
> -<br class="gmail_msg">
> - case '[':<br class="gmail_msg">
> - // Array member access, or treating pointer as an array<br class="gmail_msg">
> - if (var_path.size() > 2) // Need at least two brackets and a number<br class="gmail_msg">
> - {<br class="gmail_msg">
> - char *end = nullptr;<br class="gmail_msg">
> - long child_index = ::strtol(&var_path[1], &end, 0);<br class="gmail_msg">
> - if (end && *end == ']' &&<br class="gmail_msg">
> - *(end - 1) != '[') // this code forces an error in the case of<br class="gmail_msg">
> - // arr[]. as bitfield[] is not a good<br class="gmail_msg">
> - // syntax we're good to go<br class="gmail_msg">
> - {<br class="gmail_msg">
> - if (valobj_sp->GetCompilerType().IsPointerToScalarType() &&<br class="gmail_msg">
> - deref) {<br class="gmail_msg">
> - // what we have is *ptr[low]. the most similar C++ syntax is<br class="gmail_msg">
> - // to deref ptr<br class="gmail_msg">
> - // and extract bit low out of it. reading array item low<br class="gmail_msg">
> - // would be done by saying ptr[low], without a deref * sign<br class="gmail_msg">
> - Error error;<br class="gmail_msg">
> - ValueObjectSP temp(valobj_sp->Dereference(error));<br class="gmail_msg">
> - if (error.Fail()) {<br class="gmail_msg">
> - valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> - error.SetErrorStringWithFormat(<br class="gmail_msg">
> - "could not dereference \"(%s) %s\"",<br class="gmail_msg">
> - valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> - var_expr_path_strm.GetData());<br class="gmail_msg">
> - return ValueObjectSP();<br class="gmail_msg">
> - }<br class="gmail_msg">
> - valobj_sp = temp;<br class="gmail_msg">
> - deref = false;<br class="gmail_msg">
> - } else if (valobj_sp->GetCompilerType().IsArrayOfScalarType() &&<br class="gmail_msg">
> - deref) {<br class="gmail_msg">
> - // what we have is *arr[low]. the most similar C++ syntax is<br class="gmail_msg">
> - // to get arr[0]<br class="gmail_msg">
> - // (an operation that is equivalent to deref-ing arr)<br class="gmail_msg">
> - // and extract bit low out of it. reading array item low<br class="gmail_msg">
> - // would be done by saying arr[low], without a deref * sign<br class="gmail_msg">
> - Error error;<br class="gmail_msg">
> - ValueObjectSP temp(valobj_sp->GetChildAtIndex(0, true));<br class="gmail_msg">
> - if (error.Fail()) {<br class="gmail_msg">
> - valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> - error.SetErrorStringWithFormat(<br class="gmail_msg">
> - "could not get item 0 for \"(%s) %s\"",<br class="gmail_msg">
> - valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> - var_expr_path_strm.GetData());<br class="gmail_msg">
> - return ValueObjectSP();<br class="gmail_msg">
> - }<br class="gmail_msg">
> - valobj_sp = temp;<br class="gmail_msg">
> - deref = false;<br class="gmail_msg">
> - }<br class="gmail_msg">
> -<br class="gmail_msg">
> - bool is_incomplete_array = false;<br class="gmail_msg">
> - if (valobj_sp->IsPointerType()) {<br class="gmail_msg">
> - bool is_objc_pointer = true;<br class="gmail_msg">
> -<br class="gmail_msg">
> - if (valobj_sp->GetCompilerType().GetMinimumLanguage() !=<br class="gmail_msg">
> - eLanguageTypeObjC)<br class="gmail_msg">
> - is_objc_pointer = false;<br class="gmail_msg">
> - else if (!valobj_sp->GetCompilerType().IsPointerType())<br class="gmail_msg">
> - is_objc_pointer = false;<br class="gmail_msg">
> -<br class="gmail_msg">
> - if (no_synth_child && is_objc_pointer) {<br class="gmail_msg">
> - error.SetErrorStringWithFormat(<br class="gmail_msg">
> - "\"(%s) %s\" is an Objective-C pointer, and cannot be "<br class="gmail_msg">
> - "subscripted",<br class="gmail_msg">
> - valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> - var_expr_path_strm.GetData());<br class="gmail_msg">
> -<br class="gmail_msg">
> - return ValueObjectSP();<br class="gmail_msg">
> - } else if (is_objc_pointer) {<br class="gmail_msg">
> - // dereferencing ObjC variables is not valid.. so let's try<br class="gmail_msg">
> - // and recur to synthetic children<br class="gmail_msg">
> - ValueObjectSP synthetic = valobj_sp->GetSyntheticValue();<br class="gmail_msg">
> - if (!synthetic /* no synthetic */<br class="gmail_msg">
> - || synthetic == valobj_sp) /* synthetic is the same as<br class="gmail_msg">
> - the original object */<br class="gmail_msg">
> - {<br class="gmail_msg">
> - valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> - error.SetErrorStringWithFormat(<br class="gmail_msg">
> - "\"(%s) %s\" is not an array type",<br class="gmail_msg">
> - valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> - var_expr_path_strm.GetData());<br class="gmail_msg">
> - } else if (<br class="gmail_msg">
> - static_cast<uint32_t>(child_index) >=<br class="gmail_msg">
> - synthetic<br class="gmail_msg">
> - ->GetNumChildren() /* synthetic does not have that many values */) {<br class="gmail_msg">
> - valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> - error.SetErrorStringWithFormat(<br class="gmail_msg">
> - "array index %ld is not valid for \"(%s) %s\"",<br class="gmail_msg">
> - child_index,<br class="gmail_msg">
> - valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> - var_expr_path_strm.GetData());<br class="gmail_msg">
> - } else {<br class="gmail_msg">
> - child_valobj_sp =<br class="gmail_msg">
> - synthetic->GetChildAtIndex(child_index, true);<br class="gmail_msg">
> - if (!child_valobj_sp) {<br class="gmail_msg">
> - valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> - error.SetErrorStringWithFormat(<br class="gmail_msg">
> - "array index %ld is not valid for \"(%s) %s\"",<br class="gmail_msg">
> - child_index, valobj_sp->GetTypeName().AsCString(<br class="gmail_msg">
> - "<invalid type>"),<br class="gmail_msg">
> - var_expr_path_strm.GetData());<br class="gmail_msg">
> - }<br class="gmail_msg">
> - }<br class="gmail_msg">
> - } else {<br class="gmail_msg">
> - child_valobj_sp =<br class="gmail_msg">
> - valobj_sp->GetSyntheticArrayMember(child_index, true);<br class="gmail_msg">
> - if (!child_valobj_sp) {<br class="gmail_msg">
> - valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> - error.SetErrorStringWithFormat(<br class="gmail_msg">
> - "failed to use pointer as array for index %ld for "<br class="gmail_msg">
> - "\"(%s) %s\"",<br class="gmail_msg">
> - child_index,<br class="gmail_msg">
> - valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> - var_expr_path_strm.GetData());<br class="gmail_msg">
> - }<br class="gmail_msg">
> - }<br class="gmail_msg">
> - } else if (valobj_sp->GetCompilerType().IsArrayType(<br class="gmail_msg">
> - nullptr, nullptr, &is_incomplete_array)) {<br class="gmail_msg">
> - // Pass false to dynamic_value here so we can tell the<br class="gmail_msg">
> - // difference between<br class="gmail_msg">
> - // no dynamic value and no member of this type...<br class="gmail_msg">
> - child_valobj_sp =<br class="gmail_msg">
> - valobj_sp->GetChildAtIndex(child_index, true);<br class="gmail_msg">
> - if (!child_valobj_sp &&<br class="gmail_msg">
> - (is_incomplete_array || !no_synth_child))<br class="gmail_msg">
> - child_valobj_sp =<br class="gmail_msg">
> - valobj_sp->GetSyntheticArrayMember(child_index, true);<br class="gmail_msg">
> -<br class="gmail_msg">
> - if (!child_valobj_sp) {<br class="gmail_msg">
> - valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> - error.SetErrorStringWithFormat(<br class="gmail_msg">
> - "array index %ld is not valid for \"(%s) %s\"",<br class="gmail_msg">
> - child_index,<br class="gmail_msg">
> - valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> - var_expr_path_strm.GetData());<br class="gmail_msg">
> - }<br class="gmail_msg">
> - } else if (valobj_sp->GetCompilerType().IsScalarType()) {<br class="gmail_msg">
> - // this is a bitfield asking to display just one bit<br class="gmail_msg">
> - child_valobj_sp = valobj_sp->GetSyntheticBitFieldChild(<br class="gmail_msg">
> - child_index, child_index, true);<br class="gmail_msg">
> - if (!child_valobj_sp) {<br class="gmail_msg">
> - valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> - error.SetErrorStringWithFormat(<br class="gmail_msg">
> - "bitfield range %ld-%ld is not valid for \"(%s) %s\"",<br class="gmail_msg">
> - child_index, child_index,<br class="gmail_msg">
> - valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> - var_expr_path_strm.GetData());<br class="gmail_msg">
> - }<br class="gmail_msg">
> - } else {<br class="gmail_msg">
> - ValueObjectSP synthetic = valobj_sp->GetSyntheticValue();<br class="gmail_msg">
> - if (no_synth_child /* synthetic is forbidden */ ||<br class="gmail_msg">
> - !synthetic /* no synthetic */<br class="gmail_msg">
> - || synthetic == valobj_sp) /* synthetic is the same as the<br class="gmail_msg">
> - original object */<br class="gmail_msg">
> - {<br class="gmail_msg">
> - valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> - error.SetErrorStringWithFormat(<br class="gmail_msg">
> - "\"(%s) %s\" is not an array type",<br class="gmail_msg">
> - valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> - var_expr_path_strm.GetData());<br class="gmail_msg">
> - } else if (<br class="gmail_msg">
> - static_cast<uint32_t>(child_index) >=<br class="gmail_msg">
> - synthetic<br class="gmail_msg">
> - ->GetNumChildren() /* synthetic does not have that many values */) {<br class="gmail_msg">
> - valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> - error.SetErrorStringWithFormat(<br class="gmail_msg">
> - "array index %ld is not valid for \"(%s) %s\"",<br class="gmail_msg">
> - child_index,<br class="gmail_msg">
> - valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> - var_expr_path_strm.GetData());<br class="gmail_msg">
> - } else {<br class="gmail_msg">
> - child_valobj_sp =<br class="gmail_msg">
> - synthetic->GetChildAtIndex(child_index, true);<br class="gmail_msg">
> - if (!child_valobj_sp) {<br class="gmail_msg">
> - valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> - error.SetErrorStringWithFormat(<br class="gmail_msg">
> - "array index %ld is not valid for \"(%s) %s\"",<br class="gmail_msg">
> - child_index,<br class="gmail_msg">
> - valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> - var_expr_path_strm.GetData());<br class="gmail_msg">
> - }<br class="gmail_msg">
> - }<br class="gmail_msg">
> - }<br class="gmail_msg">
> -<br class="gmail_msg">
> - if (!child_valobj_sp) {<br class="gmail_msg">
> - // Invalid array index...<br class="gmail_msg">
> - return ValueObjectSP();<br class="gmail_msg">
> - }<br class="gmail_msg">
> -<br class="gmail_msg">
> - // Erase the array member specification '[%i]' where<br class="gmail_msg">
> - // %i is the array index<br class="gmail_msg">
> - var_path.erase(0, (end - var_path.c_str()) + 1);<br class="gmail_msg">
> - separator_idx = var_path.find_first_of(".-[");<br class="gmail_msg">
> - if (use_dynamic != eNoDynamicValues) {<br class="gmail_msg">
> - ValueObjectSP dynamic_value_sp(<br class="gmail_msg">
> - child_valobj_sp->GetDynamicValue(use_dynamic));<br class="gmail_msg">
> - if (dynamic_value_sp)<br class="gmail_msg">
> - child_valobj_sp = dynamic_value_sp;<br class="gmail_msg">
> - }<br class="gmail_msg">
> - // Break out early from the switch since we were<br class="gmail_msg">
> - // able to find the child member<br class="gmail_msg">
> - break;<br class="gmail_msg">
> - } else if (end && *end == '-') {<br class="gmail_msg">
> - // this is most probably a BitField, let's take a look<br class="gmail_msg">
> - char *real_end = nullptr;<br class="gmail_msg">
> - long final_index = ::strtol(end + 1, &real_end, 0);<br class="gmail_msg">
> - bool expand_bitfield = true;<br class="gmail_msg">
> - if (real_end && *real_end == ']') {<br class="gmail_msg">
> - // if the format given is [high-low], swap range<br class="gmail_msg">
> - if (child_index > final_index) {<br class="gmail_msg">
> - long temp = child_index;<br class="gmail_msg">
> - child_index = final_index;<br class="gmail_msg">
> - final_index = temp;<br class="gmail_msg">
> - }<br class="gmail_msg">
> -<br class="gmail_msg">
> - if (valobj_sp->GetCompilerType().IsPointerToScalarType() &&<br class="gmail_msg">
> - deref) {<br class="gmail_msg">
> - // what we have is *ptr[low-high]. the most similar C++<br class="gmail_msg">
> - // syntax is to deref ptr<br class="gmail_msg">
> - // and extract bits low thru high out of it. reading array<br class="gmail_msg">
> - // items low thru high<br class="gmail_msg">
> - // would be done by saying ptr[low-high], without a deref *<br class="gmail_msg">
> - // sign<br class="gmail_msg">
> - Error error;<br class="gmail_msg">
> - ValueObjectSP temp(valobj_sp->Dereference(error));<br class="gmail_msg">
> - if (error.Fail()) {<br class="gmail_msg">
> - valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> - error.SetErrorStringWithFormat(<br class="gmail_msg">
> - "could not dereference \"(%s) %s\"",<br class="gmail_msg">
> - valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> - var_expr_path_strm.GetData());<br class="gmail_msg">
> - return ValueObjectSP();<br class="gmail_msg">
> - }<br class="gmail_msg">
> - valobj_sp = temp;<br class="gmail_msg">
> - deref = false;<br class="gmail_msg">
> - } else if (valobj_sp->GetCompilerType()<br class="gmail_msg">
> - .IsArrayOfScalarType() &&<br class="gmail_msg">
> - deref) {<br class="gmail_msg">
> - // what we have is *arr[low-high]. the most similar C++<br class="gmail_msg">
> - // syntax is to get arr[0]<br class="gmail_msg">
> - // (an operation that is equivalent to deref-ing arr)<br class="gmail_msg">
> - // and extract bits low thru high out of it. reading array<br class="gmail_msg">
> - // items low thru high<br class="gmail_msg">
> - // would be done by saying arr[low-high], without a deref *<br class="gmail_msg">
> - // sign<br class="gmail_msg">
> - Error error;<br class="gmail_msg">
> - ValueObjectSP temp(valobj_sp->GetChildAtIndex(0, true));<br class="gmail_msg">
> - if (error.Fail()) {<br class="gmail_msg">
> - valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> - error.SetErrorStringWithFormat(<br class="gmail_msg">
> - "could not get item 0 for \"(%s) %s\"",<br class="gmail_msg">
> - valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> - var_expr_path_strm.GetData());<br class="gmail_msg">
> - return ValueObjectSP();<br class="gmail_msg">
> - }<br class="gmail_msg">
> - valobj_sp = temp;<br class="gmail_msg">
> - deref = false;<br class="gmail_msg">
> - }<br class="gmail_msg">
> - /*else if (valobj_sp->IsArrayType() ||<br class="gmail_msg">
> - valobj_sp->IsPointerType())<br class="gmail_msg">
> - {<br class="gmail_msg">
> - child_valobj_sp =<br class="gmail_msg">
> - valobj_sp->GetSyntheticArrayRangeChild(child_index,<br class="gmail_msg">
> - final_index, true);<br class="gmail_msg">
> - expand_bitfield = false;<br class="gmail_msg">
> - if (!child_valobj_sp)<br class="gmail_msg">
> - {<br class="gmail_msg">
> - valobj_sp->GetExpressionPath (var_expr_path_strm,<br class="gmail_msg">
> - false);<br class="gmail_msg">
> - error.SetErrorStringWithFormat ("array range %i-%i is<br class="gmail_msg">
> - not valid for \"(%s) %s\"",<br class="gmail_msg">
> - child_index,<br class="gmail_msg">
> - final_index,<br class="gmail_msg">
> - valobj_sp->GetTypeName().AsCString("<invalid<br class="gmail_msg">
> - type>"),<br class="gmail_msg">
> - var_expr_path_strm.c_str());<br class="gmail_msg">
> - }<br class="gmail_msg">
> - }*/<br class="gmail_msg">
> -<br class="gmail_msg">
> - if (expand_bitfield) {<br class="gmail_msg">
> - child_valobj_sp = valobj_sp->GetSyntheticBitFieldChild(<br class="gmail_msg">
> - child_index, final_index, true);<br class="gmail_msg">
> - if (!child_valobj_sp) {<br class="gmail_msg">
> - valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> - error.SetErrorStringWithFormat(<br class="gmail_msg">
> - "bitfield range %ld-%ld is not valid for \"(%s) %s\"",<br class="gmail_msg">
> - child_index, final_index,<br class="gmail_msg">
> - valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> - var_expr_path_strm.GetData());<br class="gmail_msg">
> - }<br class="gmail_msg">
> - }<br class="gmail_msg">
> - }<br class="gmail_msg">
> -<br class="gmail_msg">
> - if (!child_valobj_sp) {<br class="gmail_msg">
> - // Invalid bitfield range...<br class="gmail_msg">
> - return ValueObjectSP();<br class="gmail_msg">
> - }<br class="gmail_msg">
> -<br class="gmail_msg">
> - // Erase the bitfield member specification '[%i-%i]' where<br class="gmail_msg">
> - // %i is the index<br class="gmail_msg">
> - var_path.erase(0, (real_end - var_path.c_str()) + 1);<br class="gmail_msg">
> - separator_idx = var_path.find_first_of(".-[");<br class="gmail_msg">
> - if (use_dynamic != eNoDynamicValues) {<br class="gmail_msg">
> - ValueObjectSP dynamic_value_sp(<br class="gmail_msg">
> - child_valobj_sp->GetDynamicValue(use_dynamic));<br class="gmail_msg">
> - if (dynamic_value_sp)<br class="gmail_msg">
> - child_valobj_sp = dynamic_value_sp;<br class="gmail_msg">
> - }<br class="gmail_msg">
> - // Break out early from the switch since we were<br class="gmail_msg">
> - // able to find the child member<br class="gmail_msg">
> - break;<br class="gmail_msg">
> - }<br class="gmail_msg">
> - } else {<br class="gmail_msg">
> + valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> error.SetErrorStringWithFormat(<br class="gmail_msg">
> - "invalid square bracket encountered after \"%s\" in \"%s\"",<br class="gmail_msg">
> - var_expr_path_strm.GetData(), var_path.c_str());<br class="gmail_msg">
> + "failed to use pointer as array for index %ld for "<br class="gmail_msg">
> + "\"(%s) %s\"",<br class="gmail_msg">
> + child_index,<br class="gmail_msg">
> + valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> + var_expr_path_strm.GetData());<br class="gmail_msg">
> }<br class="gmail_msg">
> - return ValueObjectSP();<br class="gmail_msg">
> + }<br class="gmail_msg">
> + } else if (valobj_sp->GetCompilerType().IsArrayType(<br class="gmail_msg">
> + nullptr, nullptr, &is_incomplete_array)) {<br class="gmail_msg">
> + // Pass false to dynamic_value here so we can tell the<br class="gmail_msg">
> + // difference between<br class="gmail_msg">
> + // no dynamic value and no member of this type...<br class="gmail_msg">
> + child_valobj_sp = valobj_sp->GetChildAtIndex(child_index, true);<br class="gmail_msg">
> + if (!child_valobj_sp && (is_incomplete_array || !no_synth_child))<br class="gmail_msg">
> + child_valobj_sp =<br class="gmail_msg">
> + valobj_sp->GetSyntheticArrayMember(child_index, true);<br class="gmail_msg">
><br class="gmail_msg">
> - default:<br class="gmail_msg">
> - // Failure...<br class="gmail_msg">
> - {<br class="gmail_msg">
> + if (!child_valobj_sp) {<br class="gmail_msg">
> + valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> + error.SetErrorStringWithFormat(<br class="gmail_msg">
> + "array index %ld is not valid for \"(%s) %s\"", child_index,<br class="gmail_msg">
> + valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> + var_expr_path_strm.GetData());<br class="gmail_msg">
> + }<br class="gmail_msg">
> + } else if (valobj_sp->GetCompilerType().IsScalarType()) {<br class="gmail_msg">
> + // this is a bitfield asking to display just one bit<br class="gmail_msg">
> + child_valobj_sp = valobj_sp->GetSyntheticBitFieldChild(<br class="gmail_msg">
> + child_index, child_index, true);<br class="gmail_msg">
> + if (!child_valobj_sp) {<br class="gmail_msg">
> + valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> + error.SetErrorStringWithFormat(<br class="gmail_msg">
> + "bitfield range %ld-%ld is not valid for \"(%s) %s\"",<br class="gmail_msg">
> + child_index, child_index,<br class="gmail_msg">
> + valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> + var_expr_path_strm.GetData());<br class="gmail_msg">
> + }<br class="gmail_msg">
> + } else {<br class="gmail_msg">
> + ValueObjectSP synthetic = valobj_sp->GetSyntheticValue();<br class="gmail_msg">
> + if (no_synth_child /* synthetic is forbidden */ ||<br class="gmail_msg">
> + !synthetic /* no synthetic */<br class="gmail_msg">
> + || synthetic == valobj_sp) /* synthetic is the same as the<br class="gmail_msg">
> + original object */<br class="gmail_msg">
> + {<br class="gmail_msg">
> + valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> + error.SetErrorStringWithFormat(<br class="gmail_msg">
> + "\"(%s) %s\" is not an array type",<br class="gmail_msg">
> + valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> + var_expr_path_strm.GetData());<br class="gmail_msg">
> + } else if (<br class="gmail_msg">
> + static_cast<uint32_t>(child_index) >=<br class="gmail_msg">
> + synthetic<br class="gmail_msg">
> + ->GetNumChildren() /* synthetic does not have that many values */) {<br class="gmail_msg">
> + valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> + error.SetErrorStringWithFormat(<br class="gmail_msg">
> + "array index %ld is not valid for \"(%s) %s\"", child_index,<br class="gmail_msg">
> + valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> + var_expr_path_strm.GetData());<br class="gmail_msg">
> + } else {<br class="gmail_msg">
> + child_valobj_sp = synthetic->GetChildAtIndex(child_index, true);<br class="gmail_msg">
> + if (!child_valobj_sp) {<br class="gmail_msg">
> valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> error.SetErrorStringWithFormat(<br class="gmail_msg">
> - "unexpected char '%c' encountered after \"%s\" in \"%s\"",<br class="gmail_msg">
> - separator_type, var_expr_path_strm.GetData(),<br class="gmail_msg">
> - var_path.c_str());<br class="gmail_msg">
> -<br class="gmail_msg">
> - return ValueObjectSP();<br class="gmail_msg">
> + "array index %ld is not valid for \"(%s) %s\"", child_index,<br class="gmail_msg">
> + valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> + var_expr_path_strm.GetData());<br class="gmail_msg">
> }<br class="gmail_msg">
> }<br class="gmail_msg">
> -<br class="gmail_msg">
> - if (child_valobj_sp)<br class="gmail_msg">
> - valobj_sp = child_valobj_sp;<br class="gmail_msg">
> -<br class="gmail_msg">
> - if (var_path.empty())<br class="gmail_msg">
> - break;<br class="gmail_msg">
> - }<br class="gmail_msg">
> - if (valobj_sp) {<br class="gmail_msg">
> - if (deref) {<br class="gmail_msg">
> - ValueObjectSP deref_valobj_sp(valobj_sp->Dereference(error));<br class="gmail_msg">
> - valobj_sp = deref_valobj_sp;<br class="gmail_msg">
> - } else if (address_of) {<br class="gmail_msg">
> - ValueObjectSP address_of_valobj_sp(valobj_sp->AddressOf(error));<br class="gmail_msg">
> - valobj_sp = address_of_valobj_sp;<br class="gmail_msg">
> - }<br class="gmail_msg">
> }<br class="gmail_msg">
> - return valobj_sp;<br class="gmail_msg">
> - } else {<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (!child_valobj_sp) {<br class="gmail_msg">
> + // Invalid array index...<br class="gmail_msg">
> + return ValueObjectSP();<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + separator_idx = var_expr.find_first_of(".-[");<br class="gmail_msg">
> + if (use_dynamic != eNoDynamicValues) {<br class="gmail_msg">
> + ValueObjectSP dynamic_value_sp(<br class="gmail_msg">
> + child_valobj_sp->GetDynamicValue(use_dynamic));<br class="gmail_msg">
> + if (dynamic_value_sp)<br class="gmail_msg">
> + child_valobj_sp = dynamic_value_sp;<br class="gmail_msg">
> + }<br class="gmail_msg">
> + // Break out early from the switch since we were able to find the child<br class="gmail_msg">
> + // member<br class="gmail_msg">
> + break;<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + // this is most probably a BitField, let's take a look<br class="gmail_msg">
> + if (index_expr.front() != '-') {<br class="gmail_msg">
> + error.SetErrorStringWithFormat("invalid range expression \"'%s'\"",<br class="gmail_msg">
> + original_index_expr.str().c_str());<br class="gmail_msg">
> + return ValueObjectSP();<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + index_expr.drop_front();<br class="gmail_msg">
> + long final_index = 0;<br class="gmail_msg">
> + if (index_expr.getAsInteger(0, final_index)) {<br class="gmail_msg">
> + error.SetErrorStringWithFormat("invalid range expression \"'%s'\"",<br class="gmail_msg">
> + original_index_expr.str().c_str());<br class="gmail_msg">
> + return ValueObjectSP();<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + // if the format given is [high-low], swap range<br class="gmail_msg">
> + if (child_index > final_index) {<br class="gmail_msg">
> + long temp = child_index;<br class="gmail_msg">
> + child_index = final_index;<br class="gmail_msg">
> + final_index = temp;<br class="gmail_msg">
> + }<br class="gmail_msg">
> +<br class="gmail_msg">
> + if (valobj_sp->GetCompilerType().IsPointerToScalarType() && deref) {<br class="gmail_msg">
> + // what we have is *ptr[low-high]. the most similar C++ syntax is to<br class="gmail_msg">
> + // deref ptr and extract bits low thru high out of it. reading array<br class="gmail_msg">
> + // items low thru high would be done by saying ptr[low-high], without<br class="gmail_msg">
> + // a deref * sign<br class="gmail_msg">
> + Error error;<br class="gmail_msg">
> + ValueObjectSP temp(valobj_sp->Dereference(error));<br class="gmail_msg">
> + if (error.Fail()) {<br class="gmail_msg">
> + valobj_sp->GetExpressionPath(var_expr_path_strm, false);<br class="gmail_msg">
> + error.SetErrorStringWithFormat(<br class="gmail_msg">
> + "could not dereference \"(%s) %s\"",<br class="gmail_msg">
> + valobj_sp->GetTypeName().AsCString("<invalid type>"),<br class="gmail_msg">
> + var_expr_path_strm.GetData());<br class="gmail_msg">
> + return ValueObjectSP();<br class="gmail_msg">
> + }<br class="gmail_msg">
> + valobj_sp = temp;<br class="gmail_msg">
> + deref = false;<br class="gmail_msg">
> + } else if (valobj_sp->GetCompilerType().</blockquote></div>