aboutsummaryrefslogtreecommitdiff
path: root/gdb/macrocmd.c
diff options
context:
space:
mode:
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>2018-10-27 21:25:44 +0200
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>2018-10-27 21:36:53 +0200
commitcd948f5b2be612b784591dbe438dc518f6b80d61 (patch)
treea0c543f7cac581ca5b53da11af38f75bcbadaea3 /gdb/macrocmd.c
parentb50a8b9a916ea2fe1379bcd8f122feef8129a0e9 (diff)
downloadgdb-cd948f5b2be612b784591dbe438dc518f6b80d61.zip
gdb-cd948f5b2be612b784591dbe438dc518f6b80d61.tar.gz
gdb-cd948f5b2be612b784591dbe438dc518f6b80d61.tar.bz2
OBVIOUS Use report_unrecognized_option_error in 'demangle' and 'info macro' commands.
Rather than have some local logic to throw an error for an unrecognized option, use the new cli-utils.h function throwing an error. At the same time, fix some wrong indentation in info_macro_command and fix a small bug in 'demangle' error handling: Without the patch: (gdb) demangle -L c++ abcd Unrecognized option 'c++' to demangle command. Try "help demangle". (gdb) With the patch: (gdb) demangle -L c++ abcd Unrecognized option '-L' to demangle command. Try "help demangle". 2018-10-27 Philippe Waroquiers <philippe.waroquiers@skynet.be> * macrocmd.c (info_macro_command): Use report_unrecognized_option_error to report a bad option and fix indentation. * demangle.c (demangle_command): Use report_unrecognized_option_error to report a bad option and correctly report the bad option.
Diffstat (limited to 'gdb/macrocmd.c')
-rw-r--r--gdb/macrocmd.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/gdb/macrocmd.c b/gdb/macrocmd.c
index e6cf921..110423f 100644
--- a/gdb/macrocmd.c
+++ b/gdb/macrocmd.c
@@ -199,13 +199,9 @@ info_macro_command (const char *args, int from_tty)
e.g. Scheme's (defmacro ->foo () "bar\n") */
processing_args = 0;
else
- {
- error (_("Unrecognized option '%.*s' to info macro command. "
- "Try \"help info macro\"."),
- int (p - arg_start), arg_start);
- }
+ report_unrecognized_option_error ("info macro", arg_start);
- arg_start = skip_spaces (p);
+ arg_start = skip_spaces (p);
}
name = arg_start;