Page MenuHomePhabricator

Improve error handling for `f s #`
ClosedPublic

Authored by amccarth on Dec 16 2015, 10:53 AM.

Details

Summary

When there were too many arguments given for the frame select command, the error message wasn't particularly helpful and then lldb would try to select frame -1, which resulted in an additional confusing error message.

This happened when the user expects f s 1 to be a short form of frame select 1, but the f itself is an alias for frame select, so the s is extraneous.

The new output should make it easier for the user to understand what went wrong:

(lldb) f s 1
error: too many arguments; expect frame-index, saw 's'.

Command Options Usage:

frame select [-r <offset>] [<frame-index>]

     -r <offset> ( --relative <offset> )
          A relative frame index offset from the current frame index.

Diff Detail

Event Timeline

amccarth updated this revision to Diff 43033.Dec 16 2015, 10:53 AM
amccarth retitled this revision from to Improve error handling for `f s #`.
amccarth updated this object.
amccarth added reviewers: emaste, jasonmolenda.
amccarth added a subscriber: lldb-commits.
emaste accepted this revision.EditedDec 17 2015, 11:16 AM
emaste edited edge metadata.

LGTM
Or if you want show the set of arguments - e.g. expected frame-index, got 's 1' That might clarify the "too many arguments."

This revision is now accepted and ready to land.Dec 17 2015, 11:16 AM
Eugene.Zelenko added a subscriber: Eugene.Zelenko.

Committed in r256251. Please specify Differential revision in commit message.