[lldb-dev] Bug in OptionValuePathMappings::SetValueFromString

Zachary Turner via lldb-dev lldb-dev at lists.llvm.org
Fri Nov 18 16:14:07 PST 2016


BTW, this exact same code seems to have been copied either to or from
OptionValueFileSpecList::SetValueFromString, as it appears to have the same
bug.  Again, not sure how to see it fail in the debugger, but maybe someone
knows?

On Fri, Nov 18, 2016 at 1:07 PM Zachary Turner <zturner at google.com> wrote:

> Also, I just noticed the loop only runs one time, so it appears equivalent
> to
>
> m_path_mappings.Remove(remove_indexes.size() - 1, m_notify_changes);
>
> which seems completely wrong
>
> On Fri, Nov 18, 2016 at 1:05 PM Zachary Turner <zturner at google.com> wrote:
>
> In the switch / case handler for eVarSetOperationRemove, there is the
> following code:
>
>       if (num_remove_indexes) {
>         // Sort and then erase in reverse so indexes are always valid
>         std::sort(remove_indexes.begin(), remove_indexes.end());
>         for (size_t j = num_remove_indexes - 1; j < num_remove_indexes;
> ++j) {
>           m_path_mappings.Remove(j, m_notify_changes);
>         }
>       }
>
> Should the line that calls Remove() not be like this:
>
>           m_path_mappings.Remove(*remove_indexes[j]*, m_notify_changes);
>
> ?  What effect will this have on LLDB?
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20161119/021ffc83/attachment.html>


More information about the lldb-dev mailing list