aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi/mi-cmd-break.c
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:39 +0200
commit10e578d7e00d74033ded0443422ffc509390a912 (patch)
treea68ac53300e767a8e8e93923f7fb45469fe79c5c /gdb/mi/mi-cmd-break.c
parentae064303efe5830e6b9901ce2e4ed241a3cda8e7 (diff)
downloadgdb-10e578d7e00d74033ded0443422ffc509390a912.zip
gdb-10e578d7e00d74033ded0443422ffc509390a912.tar.gz
gdb-10e578d7e00d74033ded0443422ffc509390a912.tar.bz2
gdb/mi: add a '--force-condition' flag to the '-break-insert' cmd
Add a '--force-condition' flag to the '-break-insert' command to be able to force conditions. Because the '-dprintf-insert' command uses the same mechanism as the '-break-insert' command, it obtains the '--force-condition' flag, too. gdb/ChangeLog: 2021-05-06 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * mi/mi-cmd-break.c (mi_cmd_break_insert_1): Recognize the '--force-condition' flag to force the condition in the '-break-insert' and '-dprintf-insert' commands. * 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): New proc that is called by the test. gdb/doc/ChangeLog: 2021-05-06 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> * gdb.texinfo (GDB/MI Breakpoint Commands): Mention the '--force-condition' flag of the '-break-insert' and '-dprintf-insert' commands.
Diffstat (limited to 'gdb/mi/mi-cmd-break.c')
-rw-r--r--gdb/mi/mi-cmd-break.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gdb/mi/mi-cmd-break.c b/gdb/mi/mi-cmd-break.c
index 1b7eaf5..c73548c 100644
--- a/gdb/mi/mi-cmd-break.c
+++ b/gdb/mi/mi-cmd-break.c
@@ -184,12 +184,14 @@ mi_cmd_break_insert_1 (int dprintf, const char *command, char **argv, int argc)
int is_explicit = 0;
struct explicit_location explicit_loc;
std::string extra_string;
+ bool force_condition = false;
enum opt
{
HARDWARE_OPT, TEMP_OPT, CONDITION_OPT,
IGNORE_COUNT_OPT, THREAD_OPT, PENDING_OPT, DISABLE_OPT,
TRACEPOINT_OPT,
+ FORCE_CONDITION_OPT,
QUALIFIED_OPT,
EXPLICIT_SOURCE_OPT, EXPLICIT_FUNC_OPT,
EXPLICIT_LABEL_OPT, EXPLICIT_LINE_OPT
@@ -204,6 +206,7 @@ mi_cmd_break_insert_1 (int dprintf, const char *command, char **argv, int argc)
{"f", PENDING_OPT, 0},
{"d", DISABLE_OPT, 0},
{"a", TRACEPOINT_OPT, 0},
+ {"-force-condition", FORCE_CONDITION_OPT, 0},
{"-qualified", QUALIFIED_OPT, 0},
{"-source" , EXPLICIT_SOURCE_OPT, 1},
{"-function", EXPLICIT_FUNC_OPT, 1},
@@ -270,6 +273,9 @@ mi_cmd_break_insert_1 (int dprintf, const char *command, char **argv, int argc)
is_explicit = 1;
explicit_loc.line_offset = linespec_parse_line_offset (oarg);
break;
+ case FORCE_CONDITION_OPT:
+ force_condition = true;
+ break;
}
}
@@ -354,7 +360,7 @@ mi_cmd_break_insert_1 (int dprintf, const char *command, char **argv, int argc)
create_breakpoint (get_current_arch (), location.get (), condition, thread,
extra_string.c_str (),
- false,
+ force_condition,
0 /* condition and thread are valid. */,
temp_p, type_wanted,
ignore_count,