diff options
author | Philippe Waroquiers <philippe.waroquiers@skynet.be> | 2018-05-05 20:20:56 +0200 |
---|---|---|
committer | Philippe Waroquiers <philippe.waroquiers@skynet.be> | 2018-07-12 22:50:26 +0200 |
commit | 529c08b25ec7b9ba2a0b94083a08ec8d1a6e5528 (patch) | |
tree | 9f4d98aff8f3da082633324582d930f7f8120edd /gdb/testsuite | |
parent | 78da84f9940586202deb4e43decea6d32d237080 (diff) | |
download | gdb-529c08b25ec7b9ba2a0b94083a08ec8d1a6e5528.zip gdb-529c08b25ec7b9ba2a0b94083a08ec8d1a6e5528.tar.gz gdb-529c08b25ec7b9ba2a0b94083a08ec8d1a6e5528.tar.bz2 |
Add helper functions parse_flags and parse_flags_qcs
Add helper functions parse_flags and parse_flags_qcs.
parse_flags helper function allows to look for a set of flags at
the start of a string.
A flag must be given individually.
parse_flags_qcs is a specialised helper function to handle
the flags -q, -c and -s, that are used in the new command 'frame apply'
and in the command 'thread apply.
Modify number_or_range_parser::get_number to differentiate a
- followed by digits from a - followed by an alpha (i.e. a flag or an option).
That is needed for the addition of the [FLAG]... arguments to
thread apply ID... [FLAG]... COMMAND
Remove bool number_or_range_parser::m_finished, rather
implement the 'finished' logic inside number_or_range_parser::finished.
The new logic properly detects the end of parsing even if not at
end of the string. This ensures that number_or_range_parser::cur_tok
really points past the last parsed token when parsing is finished.
Before, it was always pointing at the end of the string.
As parsing now is finished directly when not positioned on a number,
number_is_in_list must do an error check before the loop getting all
numbers.
The error message for 'thread apply -$unknownconvvar p 1'
is now the more clear:
Convenience variable must have integer value.
Invalid thread ID: -$unknownconvvar p 1
instead of previously:
negative value
gdb/ChangeLog
2018-07-12 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* cli-utils.c (number_or_range_parser::get_number): Only handle
numbers or convenience var as numbers.
(parse_flags): New function.
(parse_flags_qcs): New function.
(number_or_range_parser::finished): Ensure parsing end is detected
before end of string.
* cli-utils.h (parse_flags): New function.
(parse_flags_qcs): New function.
(number_or_range_parser): Remove m_finished bool.
(number_or_range_parser::skip_range): Set m_in_range to false.
gdb/testsuite/ChangeLog
2018-07-12 Philippe Waroquiers <philippe.waroquiers@skynet.be>
* gdb.base/skip.exp: Update expected error message.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/skip.exp | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 2ddf7f8..95ad798 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2018-07-12 Philippe Waroquiers <philippe.waroquiers@skynet.be> + + * gdb.base/skip.exp: Update expected error message. + 2018-07-11 Sergio Durigan Junior <sergiodj@redhat.com> Jan Kratochvil <jan.kratochvil@redhat.com> Paul Fertser <fercerpav@gmail.com> diff --git a/gdb/testsuite/gdb.base/skip.exp b/gdb/testsuite/gdb.base/skip.exp index 4b556b1..223c93d 100644 --- a/gdb/testsuite/gdb.base/skip.exp +++ b/gdb/testsuite/gdb.base/skip.exp @@ -69,9 +69,9 @@ gdb_test "skip function baz" "Function baz will be skipped when stepping\." gdb_test "skip enable 999" "No skiplist entries found with number 999." gdb_test "skip disable 999" "No skiplist entries found with number 999." gdb_test "skip delete 999" "No skiplist entries found with number 999." -gdb_test "skip enable a" "Args must be numbers or '\\$' variables." -gdb_test "skip disable a" "Args must be numbers or '\\$' variables." -gdb_test "skip delete a" "Args must be numbers or '\\$' variables." +gdb_test "skip enable a" "Arguments must be numbers or '\\$' variables." +gdb_test "skip disable a" "Arguments must be numbers or '\\$' variables." +gdb_test "skip delete a" "Arguments must be numbers or '\\$' variables." # Ask for info on a skiplist entry which doesn't exist. |