aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli/cli-decode.h
diff options
context:
space:
mode:
authorJerome Guitton <guitton@adacore.com>2017-01-10 15:15:53 +0100
committerJerome Guitton <guitton@adacore.com>2017-02-08 19:03:25 +0100
commit604c4576fdcfc4e7c28f569b3748a1b6b4e0dbd4 (patch)
tree49f6059faa172e3ff89401319709a6f7ef2cff95 /gdb/cli/cli-decode.h
parent3d7b173c29900879c9a5958dd6029fd36666e57c (diff)
downloadfsf-binutils-gdb-604c4576fdcfc4e7c28f569b3748a1b6b4e0dbd4.zip
fsf-binutils-gdb-604c4576fdcfc4e7c28f569b3748a1b6b4e0dbd4.tar.gz
fsf-binutils-gdb-604c4576fdcfc4e7c28f569b3748a1b6b4e0dbd4.tar.bz2
Command abbreviation in define
When defining a new macro, "command" is not recognized as an alias for "commands": (gdb) define breakmain Type commands for definition of "breakmain". End with a line saying just "end". >break main >command >echo "IN MAIN\n" >end (gdb) There is a special case for while-stepping, where 'ws' and 'stepping' are recognized explicitely. Instead of adding more special cases, this change uses cli-decode. gdb/ChangeLog: * cli/cli-decode.c (find_command_name_length): Make it extern. * cli/cli-decode.h (find_command_name_length): Declare. * cli/cli-script.c (command_name_equals, line_first_arg): New functions. (process_next_line): Use cli-decode to parse command names. (build_command_line): Make args a constant pointer. gdb/testsuite/ChangeLog: * gdb.base/define.exp: Add test for command abbreviations in define.
Diffstat (limited to 'gdb/cli/cli-decode.h')
-rw-r--r--gdb/cli/cli-decode.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/gdb/cli/cli-decode.h b/gdb/cli/cli-decode.h
index e5ab839..66159fd 100644
--- a/gdb/cli/cli-decode.h
+++ b/gdb/cli/cli-decode.h
@@ -253,4 +253,6 @@ extern const char * const auto_boolean_enums[];
extern int cli_user_command_p (struct cmd_list_element *);
+extern int find_command_name_length (const char *);
+
#endif /* !defined (CLI_DECODE_H) */