aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.mi
diff options
context:
space:
mode:
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>2021-05-06 10:13:06 +0200
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>2021-05-06 10:46:40 +0200
commit79aabb7308cd572fff21da5c93952a1bb0dc5b26 (patch)
tree9d210659cd58e30967e664791578974a06c64625 /gdb/testsuite/gdb.mi
parent10e578d7e00d74033ded0443422ffc509390a912 (diff)
downloadgdb-79aabb7308cd572fff21da5c93952a1bb0dc5b26.zip
gdb-79aabb7308cd572fff21da5c93952a1bb0dc5b26.tar.gz
gdb-79aabb7308cd572fff21da5c93952a1bb0dc5b26.tar.bz2
gdb/mi: add a '--force' flag to the '-break-condition' command
Add a '--force' flag to the '-break-condition' command to be able to force conditions. gdb/ChangeLog: 2021-05-06 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * mi/mi-cmd-break.c (mi_cmd_break_condition): New function. * mi/mi-cmds.c: Change the binding of "-break-condition" to mi_cmd_break_condition. * mi/mi-cmds.h (mi_cmd_break_condition): Declare. * breakpoint.h (set_breakpoint_condition): Declare a new overload. * breakpoint.c (set_breakpoint_condition): New overloaded function extracted out from ... (condition_command): ... this. * NEWS: Mention the change. gdb/testsuite/ChangeLog: 2021-05-06 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * gdb.mi/mi-break.exp (test_forced_conditions): Add a test for the -break-condition command's "--force" flag. gdb/doc/ChangeLog: 2021-05-06 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * gdb.texinfo (GDB/MI Breakpoint Commands): Mention the '--force' flag of the '-break-condition' command.
Diffstat (limited to 'gdb/testsuite/gdb.mi')
-rw-r--r--gdb/testsuite/gdb.mi/mi-break.exp11
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.mi/mi-break.exp b/gdb/testsuite/gdb.mi/mi-break.exp
index 3b264ec..b6ef348 100644
--- a/gdb/testsuite/gdb.mi/mi-break.exp
+++ b/gdb/testsuite/gdb.mi/mi-break.exp
@@ -424,6 +424,17 @@ proc_with_prefix test_forced_conditions {} {
mi_gdb_test "-dprintf-insert -c bad --force-condition callme \"Hello\"" \
"${warning}\\^done,$bp" \
"dprintf with forced condition"
+
+ # Define a plain breakpoint first, and a condition later.
+ mi_create_breakpoint "callme" "define a bp" ""
+ mi_gdb_test "-break-condition --force 16 bad == 42" \
+ "${warning}\\^done" \
+ "invalid condition is forced"
+ set args [list -cond "bad == 42" -locations "\\\[$loc\\\]"]
+ set bp [eval mi_make_breakpoint_multi $args]
+ mi_gdb_test "-break-info 16" \
+ "\\^done,[mi_make_breakpoint_table [list $bp]]" \
+ "invalid condition is defined"
}
proc test_break {mi_mode} {