-# Copyright 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Copyright 2002-2016 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-gdb@prep.ai.mit.edu
-
# This file tests MI thread commands.
# Specifically, we are testing the MI command set and the console (in MI)
# command set ("interpreter-exec") and that the commands that are executed
# via these command pathways are properly executed. Console commands
# executed via MI should use MI output wrappers, MI event handlers, etc.
-# This only works with native configurations
-if {![isnative]} {
- return
-}
-
load_lib mi-support.exp
set MIFLAGS "-i=mi"
set thread_list [get_mi_thread_list "in check_mi_thread_command_set"]
mi_gdb_test "-thread-select" \
- {\^error,msg="mi_cmd_thread_select: USAGE: threadnum."} \
+ {\^error,msg="-thread-select: USAGE: threadnum."} \
"check_mi_thread_command_set: -thread-select"
mi_gdb_test "-thread-select 123456789" \
"\\^done,new-thread-id=\"$thread\",frame={.*}(,line=\"(-)?\[0-9\]+\",file=\".*\")?" \
"check_mi_thread_command_set: -thread-select $thread"
}
+
+ foreach thread $thread_list {
+ mi_gdb_test "-interpreter-exec console \"thread $thread\"" \
+ ".*=thread-selected,id=\"$thread\".*\r\n\\^done" \
+ "check =thread-selected: thread $thread"
+ }
}
#
# Start here
#
-set testfile "pthreads"
-set srcfile "$testfile.c"
-set binfile "$objdir/$subdir/mi-$testfile"
+standard_testfile pthreads.c
-set options [list debug incdir=$objdir]
+set options [list debug]
if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" $binfile executable $options] != "" } {
return -1
}