Page MenuHomePhabricator

Fix duplicate suggestions after an ambiguous command
ClosedPublic

Authored by teemperor on Jul 26 2018, 10:07 AM.

Details

Summary

So far lldb is printing this when it finds an ambiguous command:

(lldb) g
Ambiguous command 'g'. Possible matches:
        gdb-remote
        gui
        gdb-remote
        gui

The duplicates come from the fact that we call the same query twice with the same parameters
and add it to the same list. This patch just removes the second query call to GetCommandObject.

As GetCommandObject is const and the name parameter is also not modified, this shouldn't break
anything else. I didn't merge the remaining if statement into the else as I think otherwise the
if obj==nullptr do X else Y pattern in there becomes hard to recognize.

Diff Detail

Event Timeline

teemperor created this revision.Jul 26 2018, 10:07 AM
davide accepted this revision.Jul 26 2018, 10:13 AM

LG. thanks for improving the interface, I think all these cleanups are really good.

This revision is now accepted and ready to land.Jul 26 2018, 10:13 AM
This revision was automatically updated to reflect the committed changes.