diff options
author | Tom Tromey <tromey@adacore.com> | 2021-08-30 13:58:48 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2021-12-02 08:58:22 -0700 |
commit | 8a18382f94515b4be7e51dbe3865d202403d21d5 (patch) | |
tree | c3621e18b8693281e0b45d5a1db988bd103f0947 /gdb/breakpoint.c | |
parent | 36cb9e7e17cae5e05f007f37e555873c4f22594a (diff) | |
download | gdb-8a18382f94515b4be7e51dbe3865d202403d21d5.zip gdb-8a18382f94515b4be7e51dbe3865d202403d21d5.tar.gz gdb-8a18382f94515b4be7e51dbe3865d202403d21d5.tar.bz2 |
Add "task" keyword to the "watch" command
Breakpoints in gdb can be made specific to an Ada task using the
"task" qualifier. This patch applies this same idea to watchpoints.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r-- | gdb/breakpoint.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index b1eae3a..acf3881 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -10557,6 +10557,7 @@ watch_command_1 (const char *arg, int accessflag, int from_tty, the hardware watchpoint. */ bool use_mask = false; CORE_ADDR mask = 0; + int task = 0; /* Make sure that we actually have parameters to parse. */ if (arg != NULL && arg[0] != '\0') @@ -10612,6 +10613,16 @@ watch_command_1 (const char *arg, int accessflag, int from_tty, thread = thr->global_num; } + else if (toklen == 4 && startswith (tok, "task")) + { + char *tmp; + + task = strtol (value_start, &tmp, 0); + if (tmp == value_start) + error (_("Junk after task keyword.")); + if (!valid_task_id (task)) + error (_("Unknown task %d."), task); + } else if (toklen == 4 && startswith (tok, "mask")) { /* We've found a "mask" token, which means the user wants to @@ -10785,6 +10796,7 @@ watch_command_1 (const char *arg, int accessflag, int from_tty, init_raw_breakpoint_without_location (w.get (), NULL, bp_type, &watchpoint_breakpoint_ops); w->thread = thread; + w->task = task; w->disposition = disp_donttouch; w->pspace = current_program_space; w->exp = std::move (exp); |