<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
I tend to agree with Jim's point. I have sometimes put in things
that look like "dead/vestigial code", which I am actually either
planning to use later on, or actively using somewhere else. This is
a quite realistic scenario due to Swift support for LLDB existing in
an entirely separate universe. I have multiple times committed
changes to llvm.org which are - on their face - glorified no-ops,
but I actually end up using on the other side of the Swift fence.
Removing that kind of change without asking first is A Bad
Thing(TM).
<p>Also, in the not-too-distant future, people who aren't the
original authors of this area of the code will end up having to
own and make calls about it. IMO, It becomes even more important
to give everyone advance notice at that point.<br>
</p>
<p>With all of that said, in this case, I believe the change itself
is fine. I have - admittedly - not delved deep into the mechanics
of each diff, but I am just making the "judgment call" on the
removal of first_unparsed. Removing that argument is fine.<br>
As things stand, it is indeed unused. One day, we might decide we
want to do better diagnostics for summary formatters and/or frame
variable (e,g, be able to say things like "foo.bar->baz[3] not
valid - reason: baz doesn't have a member named [3] as it's not of
array or pointer type") - and then the combination of
first_unparsed and reason_to_stop would be exactly the data to
use. With that said, we don't do this now, and AFAIK there are no
explicit plans around doing it.</p>
<p>tl;dr Thanks for asking, LGTM<br>
</p>
<br>
<div class="moz-cite-prefix">On 11/18/16 12:32 PM, Zachary Turner
wrote:<br>
</div>
<blockquote
cite="mid:CAAErz9hvEccx-GbSxy2yGZmDM0ycuQznKARLzgyA-+Sg31QwUw@mail.gmail.com"
type="cite">
<div dir="ltr">I admit I've been moving somewhat fast with these
changes. The parameter in question was only used in one logging
statement, so the benefit did not seem worth the added cost of
complexity. But you're right, that involved a judgement call on
my part that I didn't vet first.
<div><br>
</div>
<div><a moz-do-not-send="true" class="GWVZpf gW" id="IloFPc-0"
href="mailto:egranata@apple.com" tabindex="-1">+Enrico
Granata</a> , who can hopefully do a post-commit review on
this. I can add it back without much effort if he feels it's
important. <br>
<br>
<div class="gmail_quote">
<div dir="ltr">On Fri, Nov 18, 2016 at 12:02 PM Jim Ingham
<<a moz-do-not-send="true"
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">I didn’t
see this patch go up for review. The parameter you
removed might have been vestigial or might have been one
that the owner of this code was planning to do something
with. Anyway, this seems to go beyond purely formal
changes and so should have been discussed. My apologies
if I just missed the review.<br class="gmail_msg">
<br class="gmail_msg">
Jim<br class="gmail_msg">
<br class="gmail_msg">
> On Nov 18, 2016, at 9:55 AM, Zachary Turner via
lldb-commits <<a moz-do-not-send="true"
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: Fri Nov 18 11:55:04 2016<br class="gmail_msg">
> New Revision: 287354<br class="gmail_msg">
><br class="gmail_msg">
> URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project?rev=287354&view=rev"
rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project?rev=287354&view=rev</a><br
class="gmail_msg">
> Log:<br class="gmail_msg">
> Resubmit "Remove an output-parameter from Variable
function".<br class="gmail_msg">
><br class="gmail_msg">
> The scanning algorithm had a few little subtleties
that I<br class="gmail_msg">
> overlooked, but this patch should fix everything.<br
class="gmail_msg">
><br class="gmail_msg">
> I still haven't changed the function to take a
StringRef since<br class="gmail_msg">
> that has some trickle down effect and is mostly
mechanical,<br class="gmail_msg">
> I just wanted to get the tricky part as isolated as
possible.<br class="gmail_msg">
><br class="gmail_msg">
> Modified:<br class="gmail_msg">
> lldb/trunk/include/lldb/Core/ValueObject.h<br
class="gmail_msg">
> lldb/trunk/source/Core/FormatEntity.cpp<br
class="gmail_msg">
> lldb/trunk/source/Core/ValueObject.cpp<br
class="gmail_msg">
>
lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.cpp<br
class="gmail_msg">
> lldb/trunk/source/Symbol/Variable.cpp<br
class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/include/lldb/Core/ValueObject.h<br
class="gmail_msg">
> URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=287354&r1=287353&r2=287354&view=diff"
rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=287354&r1=287353&r2=287354&view=diff</a><br
class="gmail_msg">
>
==============================================================================<br
class="gmail_msg">
> --- lldb/trunk/include/lldb/Core/ValueObject.h
(original)<br class="gmail_msg">
> +++ lldb/trunk/include/lldb/Core/ValueObject.h Fri
Nov 18 11:55:04 2016<br class="gmail_msg">
> @@ -394,7 +394,7 @@ public:<br class="gmail_msg">
> GetExpressionPathFormat =
eGetExpressionPathFormatDereferencePointers);<br
class="gmail_msg">
><br class="gmail_msg">
> lldb::ValueObjectSP GetValueForExpressionPath(<br
class="gmail_msg">
> - const char *expression, const char
**first_unparsed = nullptr,<br class="gmail_msg">
> + const char *expression,<br class="gmail_msg">
> ExpressionPathScanEndReason *reason_to_stop =
nullptr,<br class="gmail_msg">
> ExpressionPathEndResultType *final_value_type =
nullptr,<br class="gmail_msg">
> const GetValueForExpressionPathOptions
&options =<br class="gmail_msg">
> @@ -1002,8 +1002,7 @@ private:<br class="gmail_msg">
> virtual CompilerType MaybeCalculateCompleteType();<br
class="gmail_msg">
><br class="gmail_msg">
> lldb::ValueObjectSP GetValueForExpressionPath_Impl(<br
class="gmail_msg">
> - const char *expression_cstr, const char
**first_unparsed,<br class="gmail_msg">
> - ExpressionPathScanEndReason *reason_to_stop,<br
class="gmail_msg">
> + const char *expression_cstr,
ExpressionPathScanEndReason *reason_to_stop,<br
class="gmail_msg">
> ExpressionPathEndResultType *final_value_type,<br
class="gmail_msg">
> const GetValueForExpressionPathOptions
&options,<br class="gmail_msg">
> ExpressionPathAftermath *final_task_on_target);<br
class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Core/FormatEntity.cpp<br
class="gmail_msg">
> URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FormatEntity.cpp?rev=287354&r1=287353&r2=287354&view=diff"
rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FormatEntity.cpp?rev=287354&r1=287353&r2=287354&view=diff</a><br
class="gmail_msg">
>
==============================================================================<br
class="gmail_msg">
> --- lldb/trunk/source/Core/FormatEntity.cpp
(original)<br class="gmail_msg">
> +++ lldb/trunk/source/Core/FormatEntity.cpp Fri Nov
18 11:55:04 2016<br class="gmail_msg">
> @@ -614,7 +614,6 @@ static ValueObjectSP
ExpandIndexedExpres<br class="gmail_msg">
> if (log)<br class="gmail_msg">
> log->Printf("[ExpandIndexedExpression] name to
deref: %s",<br class="gmail_msg">
> ptr_deref_buffer.c_str());<br
class="gmail_msg">
> - const char *first_unparsed;<br class="gmail_msg">
> ValueObject::GetValueForExpressionPathOptions
options;<br class="gmail_msg">
> ValueObject::ExpressionPathEndResultType
final_value_type;<br class="gmail_msg">
> ValueObject::ExpressionPathScanEndReason
reason_to_stop;<br class="gmail_msg">
> @@ -622,20 +621,18 @@ static ValueObjectSP
ExpandIndexedExpres<br class="gmail_msg">
> (deref_pointer ?
ValueObject::eExpressionPathAftermathDereference<br
class="gmail_msg">
> :
ValueObject::eExpressionPathAftermathNothing);<br
class="gmail_msg">
> ValueObjectSP item =
valobj->GetValueForExpressionPath(<br class="gmail_msg">
> - ptr_deref_buffer.c_str(), &first_unparsed,
&reason_to_stop,<br class="gmail_msg">
> - &final_value_type, options,
&what_next);<br class="gmail_msg">
> + ptr_deref_buffer.c_str(), &reason_to_stop,
&final_value_type, options,<br class="gmail_msg">
> + &what_next);<br class="gmail_msg">
> if (!item) {<br class="gmail_msg">
> if (log)<br class="gmail_msg">
> - log->Printf("[ExpandIndexedExpression]
ERROR: unparsed portion = %s, why "<br class="gmail_msg">
> - "stopping = %d,"<br
class="gmail_msg">
> + log->Printf("[ExpandIndexedExpression]
ERROR: why stopping = %d,"<br class="gmail_msg">
> " final_value_type %d",<br
class="gmail_msg">
> - first_unparsed, reason_to_stop,
final_value_type);<br class="gmail_msg">
> + reason_to_stop, final_value_type);<br
class="gmail_msg">
> } else {<br class="gmail_msg">
> if (log)<br class="gmail_msg">
> - log->Printf("[ExpandIndexedExpression] ALL
RIGHT: unparsed portion = %s, "<br class="gmail_msg">
> - "why stopping = %d,"<br
class="gmail_msg">
> + log->Printf("[ExpandIndexedExpression] ALL
RIGHT: why stopping = %d,"<br class="gmail_msg">
> " final_value_type %d",<br
class="gmail_msg">
> - first_unparsed, reason_to_stop,
final_value_type);<br class="gmail_msg">
> + reason_to_stop, final_value_type);<br
class="gmail_msg">
> }<br class="gmail_msg">
> return item;<br class="gmail_msg">
> }<br class="gmail_msg">
> @@ -724,7 +721,6 @@ static bool DumpValue(Stream
&s, const S<br class="gmail_msg">
> int64_t index_lower = -1;<br class="gmail_msg">
> int64_t index_higher = -1;<br class="gmail_msg">
> bool is_array_range = false;<br class="gmail_msg">
> - const char *first_unparsed;<br class="gmail_msg">
> bool was_plain_var = false;<br class="gmail_msg">
> bool was_var_format = false;<br class="gmail_msg">
> bool was_var_indexed = false;<br class="gmail_msg">
> @@ -762,25 +758,23 @@ static bool DumpValue(Stream
&s, const S<br class="gmail_msg">
> log->Printf("[Debugger::FormatPrompt] symbol
to expand: %s",<br class="gmail_msg">
> expr_path.c_str());<br
class="gmail_msg">
><br class="gmail_msg">
> - target = valobj<br class="gmail_msg">
> -
->GetValueForExpressionPath(expr_path.c_str(),
&first_unparsed,<br class="gmail_msg">
> -
&reason_to_stop, &final_value_type,<br
class="gmail_msg">
> -
options, &what_next)<br class="gmail_msg">
> - .get();<br class="gmail_msg">
> + target =<br class="gmail_msg">
> + valobj<br class="gmail_msg">
> +
->GetValueForExpressionPath(expr_path.c_str(),
&reason_to_stop,<br class="gmail_msg">
> +
&final_value_type, options, &what_next)<br
class="gmail_msg">
> + .get();<br class="gmail_msg">
><br class="gmail_msg">
> if (!target) {<br class="gmail_msg">
> if (log)<br class="gmail_msg">
> - log->Printf("[Debugger::FormatPrompt]
ERROR: unparsed portion = %s, "<br class="gmail_msg">
> - "why stopping = %d,"<br
class="gmail_msg">
> + log->Printf("[Debugger::FormatPrompt]
ERROR: why stopping = %d,"<br class="gmail_msg">
> " final_value_type %d",<br
class="gmail_msg">
> - first_unparsed, reason_to_stop,
final_value_type);<br class="gmail_msg">
> + reason_to_stop,
final_value_type);<br class="gmail_msg">
> return false;<br class="gmail_msg">
> } else {<br class="gmail_msg">
> if (log)<br class="gmail_msg">
> - log->Printf("[Debugger::FormatPrompt] ALL
RIGHT: unparsed portion = "<br class="gmail_msg">
> - "%s, why stopping = %d,"<br
class="gmail_msg">
> + log->Printf("[Debugger::FormatPrompt] ALL
RIGHT: why stopping = %d,"<br class="gmail_msg">
> " final_value_type %d",<br
class="gmail_msg">
> - first_unparsed, reason_to_stop,
final_value_type);<br class="gmail_msg">
> + reason_to_stop,
final_value_type);<br class="gmail_msg">
> target = target<br class="gmail_msg">
>
->GetQualifiedRepresentationIfAvailable(<br
class="gmail_msg">
>
target->GetDynamicValueType(), true)<br
class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Core/ValueObject.cpp<br
class="gmail_msg">
> URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=287354&r1=287353&r2=287354&view=diff"
rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=287354&r1=287353&r2=287354&view=diff</a><br
class="gmail_msg">
>
==============================================================================<br
class="gmail_msg">
> --- lldb/trunk/source/Core/ValueObject.cpp (original)<br
class="gmail_msg">
> +++ lldb/trunk/source/Core/ValueObject.cpp Fri Nov 18
11:55:04 2016<br class="gmail_msg">
> @@ -1922,7 +1922,7 @@
ValueObject::GetSyntheticExpressionPathC<br
class="gmail_msg">
> // We haven't made a synthetic array member for
expression yet, so<br class="gmail_msg">
> // lets make one and cache it for any future
reference.<br class="gmail_msg">
> synthetic_child_sp = GetValueForExpressionPath(<br
class="gmail_msg">
> - expression, NULL, NULL, NULL,<br
class="gmail_msg">
> + expression, NULL, NULL,<br class="gmail_msg">
>
GetValueForExpressionPathOptions().SetSyntheticChildrenTraversal(<br
class="gmail_msg">
>
GetValueForExpressionPathOptions::SyntheticChildrenTraversal::<br
class="gmail_msg">
> None));<br class="gmail_msg">
> @@ -2166,13 +2166,11 @@ void
ValueObject::GetExpressionPath(Stre<br class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> ValueObjectSP ValueObject::GetValueForExpressionPath(<br
class="gmail_msg">
> - const char *expression, const char
**first_unparsed,<br class="gmail_msg">
> - ExpressionPathScanEndReason *reason_to_stop,<br
class="gmail_msg">
> + const char *expression,
ExpressionPathScanEndReason *reason_to_stop,<br
class="gmail_msg">
> ExpressionPathEndResultType *final_value_type,<br
class="gmail_msg">
> const GetValueForExpressionPathOptions
&options,<br class="gmail_msg">
> ExpressionPathAftermath *final_task_on_target) {<br
class="gmail_msg">
><br class="gmail_msg">
> - const char *dummy_first_unparsed;<br
class="gmail_msg">
> ExpressionPathScanEndReason dummy_reason_to_stop =<br
class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonUnknown;<br
class="gmail_msg">
> ExpressionPathEndResultType dummy_final_value_type
=<br class="gmail_msg">
> @@ -2181,8 +2179,7 @@ ValueObjectSP
ValueObject::GetValueForEx<br class="gmail_msg">
> ValueObject::eExpressionPathAftermathNothing;<br
class="gmail_msg">
><br class="gmail_msg">
> ValueObjectSP ret_val =
GetValueForExpressionPath_Impl(<br class="gmail_msg">
> - expression, first_unparsed ? first_unparsed :
&dummy_first_unparsed,<br class="gmail_msg">
> - reason_to_stop ? reason_to_stop :
&dummy_reason_to_stop,<br class="gmail_msg">
> + expression, reason_to_stop ? reason_to_stop :
&dummy_reason_to_stop,<br class="gmail_msg">
> final_value_type ? final_value_type :
&dummy_final_value_type, options,<br class="gmail_msg">
> final_task_on_target ? final_task_on_target<br
class="gmail_msg">
> :
&dummy_final_task_on_target);<br class="gmail_msg">
> @@ -2237,8 +2234,7 @@ ValueObjectSP
ValueObject::GetValueForEx<br class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> ValueObjectSP
ValueObject::GetValueForExpressionPath_Impl(<br
class="gmail_msg">
> - const char *expression_cstr, const char
**first_unparsed,<br class="gmail_msg">
> - ExpressionPathScanEndReason *reason_to_stop,<br
class="gmail_msg">
> + const char *expression_cstr2,
ExpressionPathScanEndReason *reason_to_stop,<br
class="gmail_msg">
> ExpressionPathEndResultType *final_result,<br
class="gmail_msg">
> const GetValueForExpressionPathOptions
&options,<br class="gmail_msg">
> ExpressionPathAftermath *what_next) {<br
class="gmail_msg">
> @@ -2247,12 +2243,10 @@ ValueObjectSP
ValueObject::GetValueForEx<br class="gmail_msg">
> if (!root.get())<br class="gmail_msg">
> return ValueObjectSP();<br class="gmail_msg">
><br class="gmail_msg">
> - *first_unparsed = expression_cstr;<br
class="gmail_msg">
> + llvm::StringRef remainder(expression_cstr2);<br
class="gmail_msg">
><br class="gmail_msg">
> while (true) {<br class="gmail_msg">
> -<br class="gmail_msg">
> - const char *expression_cstr =<br
class="gmail_msg">
> - *first_unparsed; // hide the top level
expression_cstr<br class="gmail_msg">
> + llvm::StringRef temp_expression = remainder;<br
class="gmail_msg">
><br class="gmail_msg">
> CompilerType root_compiler_type =
root->GetCompilerType();<br class="gmail_msg">
> CompilerType pointee_compiler_type;<br
class="gmail_msg">
> @@ -2263,20 +2257,20 @@ ValueObjectSP
ValueObject::GetValueForEx<br class="gmail_msg">
> if (pointee_compiler_type)<br class="gmail_msg">
>
pointee_compiler_type_info.Reset(pointee_compiler_type.GetTypeInfo());<br
class="gmail_msg">
><br class="gmail_msg">
> - if (!expression_cstr || *expression_cstr ==
'\0') {<br class="gmail_msg">
> + if (temp_expression.empty()) {<br
class="gmail_msg">
> *reason_to_stop =
ValueObject::eExpressionPathScanEndReasonEndOfString;<br
class="gmail_msg">
> return root;<br class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> - switch (*expression_cstr) {<br class="gmail_msg">
> + switch (temp_expression.front()) {<br
class="gmail_msg">
> case '-': {<br class="gmail_msg">
> + temp_expression =
temp_expression.drop_front();<br class="gmail_msg">
> if (options.m_check_dot_vs_arrow_syntax
&&<br class="gmail_msg">
>
root_compiler_type_info.Test(eTypeIsPointer)) // if you
are trying to<br class="gmail_msg">
>
// use -> on a<br class="gmail_msg">
>
// non-pointer and I<br class="gmail_msg">
>
// must catch the error<br class="gmail_msg">
> {<br class="gmail_msg">
> - *first_unparsed = expression_cstr;<br
class="gmail_msg">
> *reason_to_stop =<br class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonArrowInsteadOfDot;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypeInvalid;<br
class="gmail_msg">
> @@ -2287,48 +2281,46 @@ ValueObjectSP
ValueObject::GetValueForEx<br class="gmail_msg">
>
// when this is forbidden<br class="gmail_msg">
>
root_compiler_type_info.Test(eTypeIsPointer) &&<br
class="gmail_msg">
> options.m_no_fragile_ivar) {<br
class="gmail_msg">
> - *first_unparsed = expression_cstr;<br
class="gmail_msg">
> *reason_to_stop =<br class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonFragileIVarNotAllowed;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypeInvalid;<br
class="gmail_msg">
> return ValueObjectSP();<br class="gmail_msg">
> }<br class="gmail_msg">
> - if (expression_cstr[1] != '>') {<br
class="gmail_msg">
> - *first_unparsed = expression_cstr;<br
class="gmail_msg">
> + if (!temp_expression.startswith(">")) {<br
class="gmail_msg">
> *reason_to_stop =<br class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonUnexpectedSymbol;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypeInvalid;<br
class="gmail_msg">
> return ValueObjectSP();<br class="gmail_msg">
> }<br class="gmail_msg">
> - expression_cstr++; // skip the -<br
class="gmail_msg">
> }<br class="gmail_msg">
> LLVM_FALLTHROUGH;<br class="gmail_msg">
> case '.': // or fallthrough from -><br
class="gmail_msg">
> {<br class="gmail_msg">
> - if (options.m_check_dot_vs_arrow_syntax
&& *expression_cstr == '.' &&<br
class="gmail_msg">
> + if (options.m_check_dot_vs_arrow_syntax
&&<br class="gmail_msg">
> + temp_expression.front() == '.' &&<br
class="gmail_msg">
>
root_compiler_type_info.Test(eTypeIsPointer)) // if you
are trying to<br class="gmail_msg">
>
// use . on a pointer<br class="gmail_msg">
>
// and I must catch the<br class="gmail_msg">
>
// error<br class="gmail_msg">
> {<br class="gmail_msg">
> - *first_unparsed = expression_cstr;<br
class="gmail_msg">
> *reason_to_stop =<br class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonDotInsteadOfArrow;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypeInvalid;<br
class="gmail_msg">
> - return ValueObjectSP();<br class="gmail_msg">
> + return nullptr;<br class="gmail_msg">
> }<br class="gmail_msg">
> - expression_cstr++; // skip .<br
class="gmail_msg">
> - const char *next_separator =
strpbrk(expression_cstr + 1, "-.[");<br class="gmail_msg">
> + temp_expression =
temp_expression.drop_front(); // skip . or ><br
class="gmail_msg">
> +<br class="gmail_msg">
> + size_t next_sep_pos =
temp_expression.find_first_of("-.[", 1);<br
class="gmail_msg">
> ConstString child_name;<br class="gmail_msg">
> - if (!next_separator) // if no other separator
just expand this last layer<br class="gmail_msg">
> + if (next_sep_pos == llvm::StringRef::npos) //
if no other separator just<br class="gmail_msg">
> + //
expand this last layer<br class="gmail_msg">
> {<br class="gmail_msg">
> - child_name.SetCString(expression_cstr);<br
class="gmail_msg">
> + child_name.SetString(temp_expression);<br
class="gmail_msg">
> ValueObjectSP child_valobj_sp =<br
class="gmail_msg">
>
root->GetChildMemberWithName(child_name, true);<br
class="gmail_msg">
><br class="gmail_msg">
> if (child_valobj_sp.get()) // we know we are
done, so just return<br class="gmail_msg">
> {<br class="gmail_msg">
> - *first_unparsed = "";<br class="gmail_msg">
> *reason_to_stop =<br class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonEndOfString;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypePlain;<br
class="gmail_msg">
> @@ -2378,28 +2370,28 @@ ValueObjectSP
ValueObject::GetValueForEx<br class="gmail_msg">
> // so we hit the "else" branch, and return an
error<br class="gmail_msg">
> if (child_valobj_sp.get()) // if it worked,
just return<br class="gmail_msg">
> {<br class="gmail_msg">
> - *first_unparsed = "";<br class="gmail_msg">
> *reason_to_stop =<br class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonEndOfString;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypePlain;<br
class="gmail_msg">
> return child_valobj_sp;<br
class="gmail_msg">
> } else {<br class="gmail_msg">
> - *first_unparsed = expression_cstr;<br
class="gmail_msg">
> *reason_to_stop =<br class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonNoSuchChild;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypeInvalid;<br
class="gmail_msg">
> - return ValueObjectSP();<br
class="gmail_msg">
> + return nullptr;<br class="gmail_msg">
> }<br class="gmail_msg">
> } else // other layers do expand<br
class="gmail_msg">
> {<br class="gmail_msg">
> -
child_name.SetCStringWithLength(expression_cstr,<br
class="gmail_msg">
> -
next_separator - expression_cstr);<br class="gmail_msg">
> + llvm::StringRef next_separator =
temp_expression.substr(next_sep_pos);<br class="gmail_msg">
> +<br class="gmail_msg">
> +
child_name.SetString(temp_expression.slice(0,
next_sep_pos));<br class="gmail_msg">
> +<br class="gmail_msg">
> ValueObjectSP child_valobj_sp =<br
class="gmail_msg">
>
root->GetChildMemberWithName(child_name, true);<br
class="gmail_msg">
> if (child_valobj_sp.get()) // store the new
root and move on<br class="gmail_msg">
> {<br class="gmail_msg">
> root = child_valobj_sp;<br
class="gmail_msg">
> - *first_unparsed = next_separator;<br
class="gmail_msg">
> + remainder = next_separator;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypePlain;<br
class="gmail_msg">
> continue;<br class="gmail_msg">
> } else {<br class="gmail_msg">
> @@ -2448,15 +2440,14 @@ ValueObjectSP
ValueObject::GetValueForEx<br class="gmail_msg">
> if (child_valobj_sp.get()) // if it worked,
move on<br class="gmail_msg">
> {<br class="gmail_msg">
> root = child_valobj_sp;<br
class="gmail_msg">
> - *first_unparsed = next_separator;<br
class="gmail_msg">
> + remainder = next_separator;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypePlain;<br
class="gmail_msg">
> continue;<br class="gmail_msg">
> } else {<br class="gmail_msg">
> - *first_unparsed = expression_cstr;<br
class="gmail_msg">
> *reason_to_stop =<br class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonNoSuchChild;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypeInvalid;<br
class="gmail_msg">
> - return ValueObjectSP();<br
class="gmail_msg">
> + return nullptr;<br class="gmail_msg">
> }<br class="gmail_msg">
> }<br class="gmail_msg">
> break;<br class="gmail_msg">
> @@ -2474,7 +2465,6 @@ ValueObjectSP
ValueObject::GetValueForEx<br class="gmail_msg">
>
GetValueForExpressionPathOptions::SyntheticChildrenTraversal::<br
class="gmail_msg">
> None) // ...only chance left is
synthetic<br class="gmail_msg">
> {<br class="gmail_msg">
> - *first_unparsed = expression_cstr;<br
class="gmail_msg">
> *reason_to_stop =<br class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonRangeOperatorInvalid;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypeInvalid;<br
class="gmail_msg">
> @@ -2484,26 +2474,23 @@ ValueObjectSP
ValueObject::GetValueForEx<br class="gmail_msg">
>
// check that we can<br class="gmail_msg">
>
// expand bitfields<br class="gmail_msg">
> {<br class="gmail_msg">
> - *first_unparsed = expression_cstr;<br
class="gmail_msg">
> *reason_to_stop =<br class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonRangeOperatorNotAllowed;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypeInvalid;<br
class="gmail_msg">
> return ValueObjectSP();<br
class="gmail_msg">
> }<br class="gmail_msg">
> }<br class="gmail_msg">
> - if (*(expression_cstr + 1) ==<br
class="gmail_msg">
> + if (temp_expression[1] ==<br class="gmail_msg">
> ']') // if this is an unbounded range it
only works for arrays<br class="gmail_msg">
> {<br class="gmail_msg">
> if
(!root_compiler_type_info.Test(eTypeIsArray)) {<br
class="gmail_msg">
> - *first_unparsed = expression_cstr;<br
class="gmail_msg">
> *reason_to_stop =<br class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonEmptyRangeNotAllowed;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypeInvalid;<br
class="gmail_msg">
> - return ValueObjectSP();<br
class="gmail_msg">
> + return nullptr;<br class="gmail_msg">
> } else // even if something follows, we
cannot expand unbounded ranges,<br class="gmail_msg">
> // just let the caller do it<br
class="gmail_msg">
> {<br class="gmail_msg">
> - *first_unparsed = expression_cstr + 2;<br
class="gmail_msg">
> *reason_to_stop =<br class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonArrayRangeOperatorMet;<br
class="gmail_msg">
> *final_result =<br class="gmail_msg">
> @@ -2511,32 +2498,36 @@ ValueObjectSP
ValueObject::GetValueForEx<br class="gmail_msg">
> return root;<br class="gmail_msg">
> }<br class="gmail_msg">
> }<br class="gmail_msg">
> - const char *separator_position =
::strchr(expression_cstr + 1, '-');<br class="gmail_msg">
> - const char *close_bracket_position =
::strchr(expression_cstr + 1, ']');<br class="gmail_msg">
> - if (!close_bracket_position) // if there is no
], this is a syntax error<br class="gmail_msg">
> +<br class="gmail_msg">
> + size_t close_bracket_position =
temp_expression.find(']', 1);<br class="gmail_msg">
> + if (close_bracket_position ==<br
class="gmail_msg">
> + llvm::StringRef::npos) // if there is no
], this is a syntax error<br class="gmail_msg">
> {<br class="gmail_msg">
> - *first_unparsed = expression_cstr;<br
class="gmail_msg">
> *reason_to_stop =<br class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonUnexpectedSymbol;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypeInvalid;<br
class="gmail_msg">
> - return ValueObjectSP();<br class="gmail_msg">
> + return nullptr;<br class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> - if (!separator_position || separator_position
> close_bracket_position) {<br class="gmail_msg">
> + llvm::StringRef bracket_expr =<br
class="gmail_msg">
> + temp_expression.slice(1,
close_bracket_position);<br class="gmail_msg">
> +<br class="gmail_msg">
> + // If this was an empty expression it would
have been caught by the if<br class="gmail_msg">
> + // above.<br class="gmail_msg">
> + assert(!bracket_expr.empty());<br
class="gmail_msg">
> +<br class="gmail_msg">
> + if (!bracket_expr.contains('-')) {<br
class="gmail_msg">
> // if no separator, this is of the form [N].
Note that this cannot<br class="gmail_msg">
> // be an unbounded range of the form [],
because that case was handled<br class="gmail_msg">
> // above with an unconditional return.<br
class="gmail_msg">
> - char *end = NULL;<br class="gmail_msg">
> - unsigned long index =
::strtoul(expression_cstr + 1, &end, 0);<br
class="gmail_msg">
> - if (end != close_bracket_position) // if
something weird is in<br class="gmail_msg">
> - // our
way return an error<br class="gmail_msg">
> - {<br class="gmail_msg">
> - *first_unparsed = expression_cstr;<br
class="gmail_msg">
> + unsigned long index = 0;<br
class="gmail_msg">
> + if (bracket_expr.getAsInteger(0, index)) {<br
class="gmail_msg">
> *reason_to_stop =<br class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonUnexpectedSymbol;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypeInvalid;<br
class="gmail_msg">
> - return ValueObjectSP();<br
class="gmail_msg">
> + return nullptr;<br class="gmail_msg">
> }<br class="gmail_msg">
> +<br class="gmail_msg">
> // from here on we do have a valid index<br
class="gmail_msg">
> if
(root_compiler_type_info.Test(eTypeIsArray)) {<br
class="gmail_msg">
> ValueObjectSP child_valobj_sp =
root->GetChildAtIndex(index, true);<br
class="gmail_msg">
> @@ -2549,15 +2540,15 @@ ValueObjectSP
ValueObject::GetValueForEx<br class="gmail_msg">
>
root->GetSyntheticValue()->GetChildAtIndex(index,
true);<br class="gmail_msg">
> if (child_valobj_sp) {<br class="gmail_msg">
> root = child_valobj_sp;<br
class="gmail_msg">
> - *first_unparsed = end + 1; // skip ]<br
class="gmail_msg">
> + remainder =<br class="gmail_msg">
> +
temp_expression.substr(close_bracket_position + 1); //
skip ]<br class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypePlain;<br
class="gmail_msg">
> continue;<br class="gmail_msg">
> } else {<br class="gmail_msg">
> - *first_unparsed = expression_cstr;<br
class="gmail_msg">
> *reason_to_stop =<br class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonNoSuchChild;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypeInvalid;<br
class="gmail_msg">
> - return ValueObjectSP();<br
class="gmail_msg">
> + return nullptr;<br class="gmail_msg">
> }<br class="gmail_msg">
> } else if
(root_compiler_type_info.Test(eTypeIsPointer)) {<br
class="gmail_msg">
> if (*what_next ==<br class="gmail_msg">
> @@ -2575,11 +2566,10 @@ ValueObjectSP
ValueObject::GetValueForEx<br class="gmail_msg">
> Error error;<br class="gmail_msg">
> root = root->Dereference(error);<br
class="gmail_msg">
> if (error.Fail() || !root.get()) {<br
class="gmail_msg">
> - *first_unparsed = expression_cstr;<br
class="gmail_msg">
> *reason_to_stop =<br class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonDereferencingFailed;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypeInvalid;<br
class="gmail_msg">
> - return ValueObjectSP();<br
class="gmail_msg">
> + return nullptr;<br class="gmail_msg">
> } else {<br class="gmail_msg">
> *what_next =
eExpressionPathAftermathNothing;<br class="gmail_msg">
> continue;<br class="gmail_msg">
> @@ -2599,13 +2589,13 @@ ValueObjectSP
ValueObject::GetValueForEx<br class="gmail_msg">
> } else<br class="gmail_msg">
> root =
root->GetSyntheticArrayMember(index, true);<br
class="gmail_msg">
> if (!root.get()) {<br class="gmail_msg">
> - *first_unparsed = expression_cstr;<br
class="gmail_msg">
> *reason_to_stop =<br class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonNoSuchChild;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypeInvalid;<br
class="gmail_msg">
> - return ValueObjectSP();<br
class="gmail_msg">
> + return nullptr;<br class="gmail_msg">
> } else {<br class="gmail_msg">
> - *first_unparsed = end + 1; // skip ]<br
class="gmail_msg">
> + remainder =<br class="gmail_msg">
> +
temp_expression.substr(close_bracket_position + 1); //
skip ]<br class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypePlain;<br
class="gmail_msg">
> continue;<br class="gmail_msg">
> }<br class="gmail_msg">
> @@ -2613,15 +2603,13 @@ ValueObjectSP
ValueObject::GetValueForEx<br class="gmail_msg">
> } else if
(root_compiler_type_info.Test(eTypeIsScalar)) {<br
class="gmail_msg">
> root =
root->GetSyntheticBitFieldChild(index, index, true);<br
class="gmail_msg">
> if (!root.get()) {<br class="gmail_msg">
> - *first_unparsed = expression_cstr;<br
class="gmail_msg">
> *reason_to_stop =<br class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonNoSuchChild;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypeInvalid;<br
class="gmail_msg">
> - return ValueObjectSP();<br
class="gmail_msg">
> + return nullptr;<br class="gmail_msg">
> } else // we do not know how to expand
members of bitfields, so we<br class="gmail_msg">
> // just return and let the caller do
any further processing<br class="gmail_msg">
> {<br class="gmail_msg">
> - *first_unparsed = end + 1; // skip ]<br
class="gmail_msg">
> *reason_to_stop = ValueObject::<br
class="gmail_msg">
>
eExpressionPathScanEndReasonBitfieldRangeOperatorMet;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypeBitfield;<br
class="gmail_msg">
> @@ -2630,13 +2618,13 @@ ValueObjectSP
ValueObject::GetValueForEx<br class="gmail_msg">
> } else if
(root_compiler_type_info.Test(eTypeIsVector)) {<br
class="gmail_msg">
> root = root->GetChildAtIndex(index,
true);<br class="gmail_msg">
> if (!root.get()) {<br class="gmail_msg">
> - *first_unparsed = expression_cstr;<br
class="gmail_msg">
> *reason_to_stop =<br class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonNoSuchChild;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypeInvalid;<br
class="gmail_msg">
> return ValueObjectSP();<br
class="gmail_msg">
> } else {<br class="gmail_msg">
> - *first_unparsed = end + 1; // skip ]<br
class="gmail_msg">
> + remainder =<br class="gmail_msg">
> +
temp_expression.substr(close_bracket_position + 1); //
skip ]<br class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypePlain;<br
class="gmail_msg">
> continue;<br class="gmail_msg">
> }<br class="gmail_msg">
> @@ -2649,80 +2637,64 @@ ValueObjectSP
ValueObject::GetValueForEx<br class="gmail_msg">
> if (root->HasSyntheticValue())<br
class="gmail_msg">
> root = root->GetSyntheticValue();<br
class="gmail_msg">
> else if (!root->IsSynthetic()) {<br
class="gmail_msg">
> - *first_unparsed = expression_cstr;<br
class="gmail_msg">
> *reason_to_stop =<br class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonSyntheticValueMissing;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypeInvalid;<br
class="gmail_msg">
> - return ValueObjectSP();<br
class="gmail_msg">
> + return nullptr;<br class="gmail_msg">
> }<br class="gmail_msg">
> // if we are here, then root itself is a
synthetic VO.. should be good<br class="gmail_msg">
> // to go<br class="gmail_msg">
><br class="gmail_msg">
> if (!root.get()) {<br class="gmail_msg">
> - *first_unparsed = expression_cstr;<br
class="gmail_msg">
> *reason_to_stop =<br class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonSyntheticValueMissing;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypeInvalid;<br
class="gmail_msg">
> - return ValueObjectSP();<br
class="gmail_msg">
> + return nullptr;<br class="gmail_msg">
> }<br class="gmail_msg">
> root = root->GetChildAtIndex(index,
true);<br class="gmail_msg">
> if (!root.get()) {<br class="gmail_msg">
> - *first_unparsed = expression_cstr;<br
class="gmail_msg">
> *reason_to_stop =<br class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonNoSuchChild;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypeInvalid;<br
class="gmail_msg">
> - return ValueObjectSP();<br
class="gmail_msg">
> + return nullptr;<br class="gmail_msg">
> } else {<br class="gmail_msg">
> - *first_unparsed = end + 1; // skip ]<br
class="gmail_msg">
> + remainder =<br class="gmail_msg">
> +
temp_expression.substr(close_bracket_position + 1); //
skip ]<br class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypePlain;<br
class="gmail_msg">
> continue;<br class="gmail_msg">
> }<br class="gmail_msg">
> } else {<br class="gmail_msg">
> - *first_unparsed = expression_cstr;<br
class="gmail_msg">
> *reason_to_stop =<br class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonNoSuchChild;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypeInvalid;<br
class="gmail_msg">
> - return ValueObjectSP();<br
class="gmail_msg">
> - }<br class="gmail_msg">
> - } else // we have a low and a high index<br
class="gmail_msg">
> - {<br class="gmail_msg">
> - char *end = NULL;<br class="gmail_msg">
> - unsigned long index_lower =
::strtoul(expression_cstr + 1, &end, 0);<br
class="gmail_msg">
> - if (end != separator_position) // if
something weird is in our<br class="gmail_msg">
> - // way return
an error<br class="gmail_msg">
> - {<br class="gmail_msg">
> - *first_unparsed = expression_cstr;<br
class="gmail_msg">
> - *reason_to_stop =<br class="gmail_msg">
> -
ValueObject::eExpressionPathScanEndReasonUnexpectedSymbol;<br
class="gmail_msg">
> - *final_result =
ValueObject::eExpressionPathEndResultTypeInvalid;<br
class="gmail_msg">
> - return ValueObjectSP();<br
class="gmail_msg">
> + return nullptr;<br class="gmail_msg">
> }<br class="gmail_msg">
> - unsigned long index_higher =
::strtoul(separator_position + 1, &end, 0);<br
class="gmail_msg">
> - if (end != close_bracket_position) // if
something weird is in<br class="gmail_msg">
> - // our
way return an error<br class="gmail_msg">
> - {<br class="gmail_msg">
> - *first_unparsed = expression_cstr;<br
class="gmail_msg">
> + } else {<br class="gmail_msg">
> + // we have a low and a high index<br
class="gmail_msg">
> + llvm::StringRef sleft, sright;<br
class="gmail_msg">
> + unsigned long low_index, high_index;<br
class="gmail_msg">
> + std::tie(sleft, sright) =
bracket_expr.split('-');<br class="gmail_msg">
> + if (sleft.getAsInteger(0, low_index) ||<br
class="gmail_msg">
> + sright.getAsInteger(0, high_index)) {<br
class="gmail_msg">
> *reason_to_stop =<br class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonUnexpectedSymbol;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypeInvalid;<br
class="gmail_msg">
> - return ValueObjectSP();<br
class="gmail_msg">
> + return nullptr;<br class="gmail_msg">
> }<br class="gmail_msg">
> - if (index_lower > index_higher) // swap
indices if required<br class="gmail_msg">
> - std::swap(index_lower, index_higher);<br
class="gmail_msg">
> +<br class="gmail_msg">
> + if (low_index > high_index) // swap
indices if required<br class="gmail_msg">
> + std::swap(low_index, high_index);<br
class="gmail_msg">
><br class="gmail_msg">
> if (root_compiler_type_info.Test(<br
class="gmail_msg">
> eTypeIsScalar)) // expansion only
works for scalars<br class="gmail_msg">
> {<br class="gmail_msg">
> - root =<br class="gmail_msg">
> -
root->GetSyntheticBitFieldChild(index_lower,
index_higher, true);<br class="gmail_msg">
> + root =
root->GetSyntheticBitFieldChild(low_index, high_index,
true);<br class="gmail_msg">
> if (!root.get()) {<br class="gmail_msg">
> - *first_unparsed = expression_cstr;<br
class="gmail_msg">
> *reason_to_stop =<br class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonNoSuchChild;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypeInvalid;<br
class="gmail_msg">
> - return ValueObjectSP();<br
class="gmail_msg">
> + return nullptr;<br class="gmail_msg">
> } else {<br class="gmail_msg">
> - *first_unparsed = end + 1; // skip ]<br
class="gmail_msg">
> *reason_to_stop = ValueObject::<br
class="gmail_msg">
>
eExpressionPathScanEndReasonBitfieldRangeOperatorMet;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypeBitfield;<br
class="gmail_msg">
> @@ -2739,17 +2711,15 @@ ValueObjectSP
ValueObject::GetValueForEx<br class="gmail_msg">
> Error error;<br class="gmail_msg">
> root = root->Dereference(error);<br
class="gmail_msg">
> if (error.Fail() || !root.get()) {<br
class="gmail_msg">
> - *first_unparsed = expression_cstr;<br
class="gmail_msg">
> *reason_to_stop =<br class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonDereferencingFailed;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypeInvalid;<br
class="gmail_msg">
> - return ValueObjectSP();<br
class="gmail_msg">
> + return nullptr;<br class="gmail_msg">
> } else {<br class="gmail_msg">
> *what_next =
ValueObject::eExpressionPathAftermathNothing;<br
class="gmail_msg">
> continue;<br class="gmail_msg">
> }<br class="gmail_msg">
> } else {<br class="gmail_msg">
> - *first_unparsed = expression_cstr;<br
class="gmail_msg">
> *reason_to_stop =<br class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonArrayRangeOperatorMet;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypeBoundedRange;<br
class="gmail_msg">
> @@ -2760,12 +2730,10 @@ ValueObjectSP
ValueObject::GetValueForEx<br class="gmail_msg">
> }<br class="gmail_msg">
> default: // some non-separator is in the way<br
class="gmail_msg">
> {<br class="gmail_msg">
> - *first_unparsed = expression_cstr;<br
class="gmail_msg">
> *reason_to_stop =<br class="gmail_msg">
>
ValueObject::eExpressionPathScanEndReasonUnexpectedSymbol;<br
class="gmail_msg">
> *final_result =
ValueObject::eExpressionPathEndResultTypeInvalid;<br
class="gmail_msg">
> - return ValueObjectSP();<br class="gmail_msg">
> - break;<br class="gmail_msg">
> + return nullptr;<br class="gmail_msg">
> }<br class="gmail_msg">
> }<br class="gmail_msg">
> }<br class="gmail_msg">
><br class="gmail_msg">
> Modified:
lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.cpp<br
class="gmail_msg">
> URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.cpp?rev=287354&r1=287353&r2=287354&view=diff"
rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.cpp?rev=287354&r1=287353&r2=287354&view=diff</a><br
class="gmail_msg">
>
==============================================================================<br
class="gmail_msg">
> ---
lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.cpp
(original)<br class="gmail_msg">
> +++
lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxx.cpp
Fri Nov 18 11:55:04 2016<br class="gmail_msg">
> @@ -280,7 +280,7 @@ bool
lldb_private::formatters::LibCxxMap<br class="gmail_msg">
> // die and free their memory<br class="gmail_msg">
> m_pair_ptr = valobj_sp<br class="gmail_msg">
> ->GetValueForExpressionPath(<br
class="gmail_msg">
> - ".__i_.__ptr_->__value_",
nullptr, nullptr, nullptr,<br class="gmail_msg">
> + ".__i_.__ptr_->__value_",
nullptr, nullptr,<br class="gmail_msg">
>
ValueObject::GetValueForExpressionPathOptions()<br
class="gmail_msg">
>
.DontCheckDotVsArrowSyntax()<br class="gmail_msg">
>
.SetSyntheticChildrenTraversal(<br class="gmail_msg">
> @@ -288,16 +288,18 @@ bool
lldb_private::formatters::LibCxxMap<br class="gmail_msg">
>
SyntheticChildrenTraversal::None),<br class="gmail_msg">
> nullptr)<br class="gmail_msg">
> .get();<br class="gmail_msg">
> -<br class="gmail_msg">
> +<br class="gmail_msg">
> if (!m_pair_ptr) {<br class="gmail_msg">
> - m_pair_ptr =
valobj_sp->GetValueForExpressionPath(".__i_.__ptr_",
nullptr, nullptr, nullptr,<br class="gmail_msg">
> -
ValueObject::GetValueForExpressionPathOptions()<br
class="gmail_msg">
> -
.DontCheckDotVsArrowSyntax()<br class="gmail_msg">
> -
.SetSyntheticChildrenTraversal(<br class="gmail_msg">
> -
ValueObject::GetValueForExpressionPathOptions::<br
class="gmail_msg">
> -
SyntheticChildrenTraversal::None),<br class="gmail_msg">
> -
nullptr)<br class="gmail_msg">
> - .get();<br class="gmail_msg">
> + m_pair_ptr = valobj_sp<br class="gmail_msg">
> + ->GetValueForExpressionPath(<br
class="gmail_msg">
> + ".__i_.__ptr_", nullptr,
nullptr,<br class="gmail_msg">
> +
ValueObject::GetValueForExpressionPathOptions()<br
class="gmail_msg">
> +
.DontCheckDotVsArrowSyntax()<br class="gmail_msg">
> +
.SetSyntheticChildrenTraversal(<br class="gmail_msg">
> +
ValueObject::GetValueForExpressionPathOptions::<br
class="gmail_msg">
> +
SyntheticChildrenTraversal::None),<br class="gmail_msg">
> + nullptr)<br
class="gmail_msg">
> + .get();<br class="gmail_msg">
> if (m_pair_ptr) {<br class="gmail_msg">
> auto
__i_(valobj_sp->GetChildMemberWithName(g___i_, true));<br
class="gmail_msg">
> lldb::TemplateArgumentKind kind;<br
class="gmail_msg">
><br class="gmail_msg">
> Modified: lldb/trunk/source/Symbol/Variable.cpp<br
class="gmail_msg">
> URL: <a moz-do-not-send="true"
href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Variable.cpp?rev=287354&r1=287353&r2=287354&view=diff"
rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Variable.cpp?rev=287354&r1=287353&r2=287354&view=diff</a><br
class="gmail_msg">
>
==============================================================================<br
class="gmail_msg">
> --- lldb/trunk/source/Symbol/Variable.cpp (original)<br
class="gmail_msg">
> +++ lldb/trunk/source/Symbol/Variable.cpp Fri Nov 18
11:55:04 2016<br class="gmail_msg">
> @@ -404,16 +404,14 @@ Error
Variable::GetValuesForVariableExpr<br class="gmail_msg">
> const char *variable_sub_expr_path
=<br class="gmail_msg">
> variable_expr_path +
variable_name.size();<br class="gmail_msg">
> if (*variable_sub_expr_path) {<br
class="gmail_msg">
> - const char *first_unparsed =
nullptr;<br class="gmail_msg">
>
ValueObject::ExpressionPathScanEndReason reason_to_stop;<br
class="gmail_msg">
>
ValueObject::ExpressionPathEndResultType
final_value_type;<br class="gmail_msg">
>
ValueObject::GetValueForExpressionPathOptions options;<br
class="gmail_msg">
>
ValueObject::ExpressionPathAftermath
final_task_on_target;<br class="gmail_msg">
><br class="gmail_msg">
> valobj_sp =
variable_valobj_sp->GetValueForExpressionPath(<br
class="gmail_msg">
> - variable_sub_expr_path,
&first_unparsed,<br class="gmail_msg">
> - &reason_to_stop,
&final_value_type, options,<br class="gmail_msg">
> - &final_task_on_target);<br
class="gmail_msg">
> + variable_sub_expr_path,
&reason_to_stop,<br class="gmail_msg">
> + &final_value_type,
options, &final_task_on_target);<br class="gmail_msg">
> if (!valobj_sp) {<br
class="gmail_msg">
> error.SetErrorStringWithFormat(<br
class="gmail_msg">
> "invalid expression path
'%s' for variable '%s'",<br class="gmail_msg">
><br class="gmail_msg">
><br class="gmail_msg">
> _______________________________________________<br
class="gmail_msg">
> lldb-commits mailing list<br class="gmail_msg">
> <a moz-do-not-send="true"
href="mailto:lldb-commits@lists.llvm.org"
class="gmail_msg" target="_blank">lldb-commits@lists.llvm.org</a><br
class="gmail_msg">
> <a moz-do-not-send="true"
href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits"
rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br
class="gmail_msg">
<br class="gmail_msg">
</blockquote>
</div>
</div>
</div>
</blockquote>
<br>
</body>
</html>