This support requires that GDB be built with Python scripting
enabled.
+* For the break command, multiple uses of the 'thread' or 'task'
+ keywords will now give an error instead of just using the thread or
+ task id from the last instance of the keyword. E.g.:
+ break foo thread 1 thread 2
+ will now give an error rather than using 'thread 2'.
+
+* For the watch command, multiple uses of the 'task' keyword will now
+ give an error instead of just using the task id from the last
+ instance of the keyword. E.g.:
+ watch my_var task 1 task 2
+ will now give an error rather than using 'task 2'. The 'thread'
+ keyword already gave an error when used multiple times with the
+ watch command, this remains unchanged.
+
* New commands
maintenance print record-instruction [ N ]
const char *tmptok;
struct thread_info *thr;
+ if (*thread != -1)
+ error(_("You can specify only one thread."));
+
tok = end_tok + 1;
thr = parse_thread_id (tok, &tmptok);
if (tok == tmptok)
{
char *tmptok;
+ if (*task != 0)
+ error(_("You can specify only one task."));
+
tok = end_tok + 1;
*task = strtol (tok, &tmptok, 0);
if (tok == tmptok)
{
char *tmp;
+ if (task != 0)
+ error(_("You can specify only one task."));
+
task = strtol (value_start, &tmp, 0);
if (tmp == value_start)
error (_("Junk after task keyword."));
"\r\n"] \
"info tasks before inserting breakpoint"
+# Check that multiple uses of the 'task' keyword will give an error.
+gdb_test "break break_me task 1 task 3" "You can specify only one task\\."
+gdb_test "watch j task 1 task 3" "You can specify only one task\\."
+
# Insert a breakpoint that should stop only if task 1 stops. Since
# task 1 never calls break_me, this shouldn't actually ever trigger.
# The fact that this breakpoint is created _before_ the next one
foreach suffix {"" " " " thread 1"} {
foreach cond {"" " if 1"} {
with_test_prefix "prefix: '$prefix', suffix: '$suffix', cond: '$cond'" {
- gdb_breakpoint "main ${prefix}-force-condition${suffix}${cond}"\
- "message"
+
+ if { [regexp thread $prefix] && [regexp thread $suffix] } {
+ gdb_test "break main ${prefix}-force-condition${suffix}${cond}" \
+ "You can specify only one thread\\."
+ } else {
+ gdb_breakpoint "main ${prefix}-force-condition${suffix}${cond}"\
+ "message"
+ }
}
}
}
return -1
}
+ # Check that multiple uses of 'thread' keyword give an error.
+ gdb_test "break main thread $start_thre thread $main_thre" \
+ "You can specify only one thread\\."
+
# Set a thread-specific breakpoint at "main". This can't ever
# be hit, but that's OK.
gdb_breakpoint "main thread $start_thre"
return -1
}
+# Check that multiple uses of the 'thread' keyword will give an error.
+gdb_test "watch x thread 1 thread 2" "You can specify only one thread\\."
+
# Watch X, it will be modified by all threads.
# We want this watchpoint to be set *after* all threads are running.
gdb_test "watch x" "Hardware watchpoint 3: x"