diff options
author | Simon Marchi <simon.marchi@polymtl.ca> | 2022-11-23 13:39:46 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2022-11-24 10:22:40 -0500 |
commit | 4d70f72ee0c4ee7798aae1ed8c8a6f155cf85163 (patch) | |
tree | 672e2a9d556b5e848cd66be54844c689b5f8e013 | |
parent | 0075c53724f78c78aa1692cc8e3bf1433eeb0b9f (diff) | |
download | gdb-4d70f72ee0c4ee7798aae1ed8c8a6f155cf85163.zip gdb-4d70f72ee0c4ee7798aae1ed8c8a6f155cf85163.tar.gz gdb-4d70f72ee0c4ee7798aae1ed8c8a6f155cf85163.tar.bz2 |
gdb/testsuite/gdb.base/break.exp: split test_break_commands_clear
Change-Id: Ia58f90117d52fc419fc494836d9b4ed5d902fe9b
Approved-By: Kevin Buettner <kevinb@redhat.com>
-rw-r--r-- | gdb/testsuite/gdb.base/break.exp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/gdb/testsuite/gdb.base/break.exp b/gdb/testsuite/gdb.base/break.exp index cb5831a..c0756cd 100644 --- a/gdb/testsuite/gdb.base/break.exp +++ b/gdb/testsuite/gdb.base/break.exp @@ -897,13 +897,21 @@ with_test_prefix "set line:file breakpoint via convenience variable" { "non-integer convenience variable disallowed" } -# # Test that commands can be cleared without error. -# -gdb_test "commands\nprint 232323\nend" ">end" "set some breakpoint commands" -gdb_test "commands\nend" ">end" "clear breakpoint commands" -# We verify that the commands were cleared by ensuring that the last -# breakpoint's location ends the output -- if there were commands, -# they would have been printed after the location. -gdb_test "info break" "$srcfile:$line_actual" "verify that they were cleared" +proc_with_prefix test_break_commands_clear {} { + clean_restart breako2 + + set line [gdb_get_line_number "set breakpoint 1 here"] + gdb_breakpoint $line + + gdb_test "commands\nprint 232323\nend" ">end" "set some breakpoint commands" + gdb_test "commands\nend" ">end" "clear breakpoint commands" + + # We verify that the commands were cleared by ensuring that the last + # breakpoint's location ends the output -- if there were commands, + # they would have been printed after the location. + gdb_test "info break" "$::srcfile:$::decimal" "verify that they were cleared" +} + +test_break_commands_clear |