mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-27 06:17:47 +08:00
Delete parse_flags/parse_flags_qcs
Now that "thread/frame apply" have been converted to the gdb::option framework, these functions are no longer used. For a while, I thought about keeping the unit tests, by making a local version of parse_flags_qcs in the unit tests file. But all that would really test that is used by GDB itself, is the validate_flags_qcs function. So in the end, I went through all the unit tests, and converted any that wasn't already covered to gdb.base/options.exp tests. And those have all already been added in previous patches. gdb/ChangeLog: 2019-06-13 Pedro Alves <palves@redhat.com> * cli/cli-utils.c (parse_flags, parse_flags_qcs): Delete. * cli/cli-utils.h (parse_flags, parse_flags_qcs): Delete. * unittests/cli-utils-selftests.c (test_parse_flags) (test_parse_flags_qcs): Delete. (test_cli_utils): Don't call deleted functions.
This commit is contained in:
@ -524,62 +524,6 @@ check_for_argument (const char **str, const char *arg, int arg_len)
|
||||
|
||||
/* See documentation in cli-utils.h. */
|
||||
|
||||
int
|
||||
parse_flags (const char **str, const char *flags)
|
||||
{
|
||||
const char *p = skip_spaces (*str);
|
||||
|
||||
if (p[0] == '-'
|
||||
&& isalpha (p[1])
|
||||
&& (p[2] == '\0' || isspace (p[2])))
|
||||
{
|
||||
const char pf = p[1];
|
||||
const char *f = flags;
|
||||
|
||||
while (*f != '\0')
|
||||
{
|
||||
if (*f == pf)
|
||||
{
|
||||
*str = skip_spaces (p + 2);
|
||||
return f - flags + 1;
|
||||
}
|
||||
f++;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* See documentation in cli-utils.h. */
|
||||
|
||||
bool
|
||||
parse_flags_qcs (const char *which_command, const char **str,
|
||||
qcs_flags *flags)
|
||||
{
|
||||
switch (parse_flags (str, "qcs"))
|
||||
{
|
||||
case 0:
|
||||
return false;
|
||||
case 1:
|
||||
flags->quiet = true;
|
||||
break;
|
||||
case 2:
|
||||
flags->cont = true;
|
||||
break;
|
||||
case 3:
|
||||
flags->silent = true;
|
||||
break;
|
||||
default:
|
||||
gdb_assert_not_reached ("int qcs flag out of bound");
|
||||
}
|
||||
|
||||
validate_flags_qcs (which_command, flags);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* See documentation in cli-utils.h. */
|
||||
|
||||
void
|
||||
validate_flags_qcs (const char *which_command, qcs_flags *flags)
|
||||
{
|
||||
|
Reference in New Issue
Block a user