-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[LLDB]Provide clearer error message for invalid commands. #111891
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
4493bf0
8dfb266
b01e120
2f83fa6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# UNSUPPORTED: system-windows | ||
# | ||
# RUN: %clang_host -g -O0 %S/Inputs/main.c -o %t.out | ||
# RUN: not %lldb -b -o 'breakpoint foo' %t.out -o exit 2>&1 | FileCheck %s --check-prefix BP-MSG | ||
# RUN: not %lldb -b -o 'watchpoint set foo' %t.out -o exit 2>&1 | FileCheck %s --check-prefix WP-MSG | ||
# CHECK: at main.c:2:21 | ||
# BP-MSG: 'foo' is not a valid subcommand of "breakpoint". Valid subcommands are: clear, command, delete, disable, enable, and others. Use "help breakpoint" to find out more. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
# WP-MSG: 'foo' is not a valid subcommand of "watchpoint set". Valid subcommands are: expression, variable. Use "help watchpoint set" to find out more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're missing a space before "is". The output will also be garbled for the case of zero subcommands (I think such a thing can happen if the user registers a custom multiword command (
SBCommandInterpreter::AddMultiwordCommand
), but does not add any subcommands to it).Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Which output? the error msg as a whole or just this function's output?
unless i'm missing something, if there are zero subcommands, the function would have returned "" on line 223, which means the error message would have been something like
"foo" is not a valid subcommand of "breakpoint". Use "help breakpoint" to find out more.
(ie., there will be no suggestions on subcommands).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. I missed the
empty()
check at the beginning of the function.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. I missed the
empty()
check at the beginning of the function.