diff options
author | Pedro Alves <palves@redhat.com> | 2017-11-07 11:00:32 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2017-11-07 11:07:19 +0000 |
commit | 95e95a6de2e4a050870c49bf52fbac0239847b63 (patch) | |
tree | c4d914376eb4b51fdec1e9047fcd0e0b12354e6f /gdb/testsuite/gdb.base/ena-dis-br.exp | |
parent | cee62dbd8771e22856d950c2615fb463305a9fcb (diff) | |
download | gdb-95e95a6de2e4a050870c49bf52fbac0239847b63.zip gdb-95e95a6de2e4a050870c49bf52fbac0239847b63.tar.gz gdb-95e95a6de2e4a050870c49bf52fbac0239847b63.tar.bz2 |
Make breakpoint/location number parsing error output consistent
... and also make GDB catch a few more cases of invalid input.
This fixes the inconsistency in GDB's output (e.g., "bad" vs "Bad")
exposed by the new tests added in the previous commit.
Also, makes the "0-0" and "inverted range" cases be loud errors.
Also makes GDB reject negative breakpoint number in ranges. We
already rejected negative number literals, but you could still subvert
that via convenience variables, like:
(gdb) set $bp -1
(gdb) disable $bp.1-2
The change to get_number_trailer fixes a bug exposed by the new tests.
The function did not handle parsing "-$num". [This wasn't visible in
the gdb.multi/tids.exp (which has similar tests) because the TID range
parsing is implemented differently.]
gdb/ChangeLog:
2017-11-07 Pedro Alves <palves@redhat.com>
* breakpoint.c (extract_bp_kind): New enum.
(extract_bp_num, extract_bp_or_bp_range): New functions, partially
factored out from ...
(extract_bp_number_and_location): ... here.
* cli/cli-utils.c (get_number_trailer): Handle '-$variable'.
gdb/testsuite/ChangeLog:
2017-11-07 Pedro Alves <palves@redhat.com>
* gdb.base/ena-dis-br.exp (test_ena_dis_br): Adjust test.
* gdb.cp/ena-dis-br-range.exp: Adjust tests.
(disable_invalid, disable_inverted, disable_negative): New
procedures.
("bad numbers"): New set of tests.
Diffstat (limited to 'gdb/testsuite/gdb.base/ena-dis-br.exp')
-rw-r--r-- | gdb/testsuite/gdb.base/ena-dis-br.exp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.base/ena-dis-br.exp b/gdb/testsuite/gdb.base/ena-dis-br.exp index 2bbb734..8655421 100644 --- a/gdb/testsuite/gdb.base/ena-dis-br.exp +++ b/gdb/testsuite/gdb.base/ena-dis-br.exp @@ -398,7 +398,7 @@ proc test_ena_dis_br { what } { # Now enable(disable) '$b4.1 fooobaar'. This should error on # fooobaar. gdb_test "$what $b4.1 fooobaar" \ - "bad breakpoint number at or near 'fooobaar'" \ + "Bad breakpoint number 'fooobaar'" \ "$what \$b4.1 fooobar" set test1 "${what}d \$b4.1" |