This is an archive of the discontinued LLVM Phabricator instance.

Fix parsing expressions to evaluate with spaces and optional args (MI)
ClosedPublic

Authored by ki.stfu on Sep 2 2016, 12:35 PM.

Details

Summary

When extracting options for long options (starting with --), the use of
MIUtilString::SplitConsiderQuotes to split all the arguments was being
conditioned on the option type to be expected. This was wrong as this caused
other options to be parsed incorrectly since it was not taking into account the
presence of quotes.

Patch by Ed Munoz <edmunoz@microsoft.com>

Diff Detail

Repository
rL LLVM

Event Timeline

edmunoz updated this revision to Diff 70209.Sep 2 2016, 12:35 PM
edmunoz retitled this revision from to [lldb-mi] Fix parsing expressions to evaluate with spaces and optional args.
edmunoz updated this object.
edmunoz added a reviewer: ki.stfu.
edmunoz set the repository for this revision to rL LLVM.
edmunoz added a project: Restricted Project.
edmunoz added a subscriber: lldb-commits.
edmunoz added inline comments.Sep 2 2016, 12:43 PM
tools/lldb-mi/MICmdArgValOptionLong.cpp
190 ↗(On Diff #70209)

We could use the size of vrwTxt.GetArgs() to reduce the number of calls to CMIUtilString::SplitConsiderQuotes in CMICmdArgContext.

I left it using the more expressive method name, but I'm open to changing it.

edmunoz updated this object.Sep 2 2016, 12:49 PM
ki.stfu accepted this revision.Sep 11 2016, 11:35 PM
ki.stfu edited edge metadata.

lgtm

@edmunoz, good job. Thank you! Would you like me to commit?

This revision is now accepted and ready to land.Sep 11 2016, 11:35 PM

lgtm

@edmunoz, good job. Thank you! Would you like me to commit?

Thanks! Yes, go ahead.

ki.stfu commandeered this revision.Sep 21 2016, 10:07 PM
ki.stfu edited reviewers, added: edmunoz; removed: ki.stfu.
This revision now requires review to proceed.Sep 21 2016, 10:07 PM
ki.stfu retitled this revision from [lldb-mi] Fix parsing expressions to evaluate with spaces and optional args to Fix parsing expressions to evaluate with spaces and optional args (MI).Sep 21 2016, 10:08 PM
ki.stfu updated this object.
ki.stfu updated this revision to Diff 72136.Sep 21 2016, 10:12 PM

Rebase againt ToT; Apply clang-format & autopep; Minor fix in condition

ki.stfu marked an inline comment as done.Sep 21 2016, 10:13 PM
ki.stfu added inline comments.
tools/lldb-mi/MICmdArgValOptionLong.cpp
187–188 ↗(On Diff #72136)

@edmunoz: I did it as you suggested.

This revision was automatically updated to reflect the committed changes.
ki.stfu marked an inline comment as done.