mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-25 16:57:52 +00:00
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.
This commit is contained in:
@@ -1255,7 +1255,9 @@ find_cmd (const char *command, int len, struct cmd_list_element *clist,
|
||||
return found;
|
||||
}
|
||||
|
||||
static int
|
||||
/* Return the length of command name in TEXT. */
|
||||
|
||||
int
|
||||
find_command_name_length (const char *text)
|
||||
{
|
||||
const char *p = text;
|
||||
|
||||
Reference in New Issue
Block a user