2011-01-01 15:34:07 +00:00
|
|
|
# Copyright 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
|
2009-01-03 05:58:08 +00:00
|
|
|
# Free Software Foundation, Inc.
|
2002-09-24 19:36:06 +00:00
|
|
|
|
|
|
|
# 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
|
2007-08-23 18:14:19 +00:00
|
|
|
# the Free Software Foundation; either version 3 of the License, or
|
2002-09-24 19:36:06 +00:00
|
|
|
# (at your option) any later version.
|
2007-08-23 18:14:19 +00:00
|
|
|
#
|
2002-09-24 19:36:06 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2007-08-23 18:14:19 +00:00
|
|
|
#
|
2002-09-24 19:36:06 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
2007-08-23 18:14:19 +00:00
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2002-09-24 19:36:06 +00:00
|
|
|
|
|
|
|
# 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.
|
|
|
|
|
|
|
|
load_lib mi-support.exp
|
|
|
|
set MIFLAGS "-i=mi"
|
|
|
|
|
|
|
|
gdb_exit
|
|
|
|
if {[mi_gdb_start]} {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
|
|
|
|
# This procedure tests the various thread commands in MI.
|
|
|
|
proc check_mi_thread_command_set {} {
|
|
|
|
|
|
|
|
mi_runto done_making_threads
|
|
|
|
|
|
|
|
set thread_list [get_mi_thread_list "in check_mi_thread_command_set"]
|
|
|
|
|
|
|
|
mi_gdb_test "-thread-select" \
|
2011-01-12 21:09:39 +00:00
|
|
|
{\^error,msg="-thread-select: USAGE: threadnum."} \
|
2002-09-24 19:36:06 +00:00
|
|
|
"check_mi_thread_command_set: -thread-select"
|
|
|
|
|
|
|
|
mi_gdb_test "-thread-select 123456789" \
|
2005-09-27 Bob Rossi <bob@brasko.net>
* gdb.mi/mi-disassemble.exp, gdb.mi/mi2-disassemble.exp: Remove .*
from test. Escape the | in mi_gdb_test call.
* gdb.mi/mi-basics.exp, gdb.mi/mi-cli.exp, gdb.mi/mi-disassemble.exp,
gdb.mi/mi-pthreads.exp, gdb.mi/mi-stack.exp, gdb.mi/mi2-basics.exp,
gdb.mi/mi2-cli.exp, gdb.mi/mi2-disassemble.exp,
gdb.mi/mi2-pthreads.exp, gdb.mi/mi2-stack.exp: Add extra details to
expected regex's in mi_gdb_test calls.
* lib/mi-support.exp: Remove arbitrary .* from tests.
(mi_gdb_test): Add string_regex variable. Add anchor to main -re.
Fully anchor GDB/MI expected results in mi_gdb_test.
* lib/gdb.exp (string_to_regexp): Escape the ] character.
* gdb.base/sizeof.exp: Remove escape character. Correct test.
2005-09-27 22:39:04 +00:00
|
|
|
{&.*\^error,msg="Thread ID 123456789 not known\."} \
|
2002-09-24 19:36:06 +00:00
|
|
|
"check_mi_thread_command_set: -thread-select 123456789"
|
|
|
|
|
|
|
|
foreach thread $thread_list {
|
2003-01-07 03:31:27 +00:00
|
|
|
# line and file are optional.
|
|
|
|
# many of the threads are blocked in libc calls,
|
|
|
|
# and many people have libc's with no symbols.
|
2002-09-24 19:36:06 +00:00
|
|
|
mi_gdb_test "-thread-select $thread" \
|
2003-01-07 03:31:27 +00:00
|
|
|
"\\^done,new-thread-id=\"$thread\",frame={.*}(,line=\"(-)?\[0-9\]+\",file=\".*\")?" \
|
2002-09-24 19:36:06 +00:00
|
|
|
"check_mi_thread_command_set: -thread-select $thread"
|
|
|
|
}
|
2008-11-17 16:43:34 +00:00
|
|
|
|
|
|
|
foreach thread $thread_list {
|
|
|
|
mi_gdb_test "-interpreter-exec console \"thread $thread\"" \
|
|
|
|
".*\\^done\r\n=thread-selected,id=\"$thread\"" \
|
|
|
|
"check =thread-selected: thread $thread"
|
|
|
|
}
|
2002-09-24 19:36:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Start here
|
|
|
|
#
|
|
|
|
set testfile "pthreads"
|
|
|
|
set srcfile "$testfile.c"
|
2004-01-13 17:08:03 +00:00
|
|
|
set binfile "$objdir/$subdir/mi-$testfile"
|
2002-09-24 19:36:06 +00:00
|
|
|
|
* configure.in: Call AC_CONFIG_HEADER. Don't call
AC_CONFIG_SUBDIRS on gdb.arch, gdb.asm, gdb.base gdb.c++ gdb.java,
gdb.disasm, gdb.mi, gdb.threads and gdb.trace. Call
AC_CHECK_HEADERS on pthread.h. Put Makefiles in the
aforementioned directories in the AC_OUPUT call.
* config.hin: New file.
* gdb.mi/gdb669.exp, gdb.mi/mi-pthreads.exp,
gdb.mi/mi1-pthreads.exp, gdb.threads/gcore-thread.exp,
gdb.threads/killed.exp, gdb.threads/print-threads.exp,
gdb.threads/pthreads.exp, gdb.threads/schedlock.exp: Make sure we
pass -I$objdir instead of -I$objdir/$subdir in compilation.
* gdb.arch/configure.in, gdb.arch/configure, gdb.asm/configure.in,
gdb.asm/configure, gdb.base/configure.in, gdb.base/configure,
gdb.c++/configure.in, gdb.c++/configure, gdb.disasm/configure.in,
gdb.disasm/configure, gdb.java/configure.in, gdb.java/configure,
gdb.mi/configure.in, gdb.mi/configure, gdb.mi/config.in,
gdb.threads/configure.in, gdb.threads/configure,
gdb.threads/config.in, gdb.trace/configure.in,
gdb.trace/configure: Removed.
2003-01-04 15:37:40 +00:00
|
|
|
set options [list debug incdir=$objdir]
|
2003-02-01 20:47:16 +00:00
|
|
|
if {[gdb_compile_pthreads "$srcdir/$subdir/$srcfile" $binfile executable $options] != "" } {
|
|
|
|
return -1
|
2002-09-24 19:36:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
mi_gdb_reinitialize_dir $srcdir/$subdir
|
|
|
|
mi_gdb_load $binfile
|
|
|
|
|
|
|
|
check_mi_thread_command_set
|
|
|
|
|
|
|
|
mi_gdb_exit
|
|
|
|
|