Mark testsuite/gdb.hp/gdb.threads-hp/ as obsolete.
This commit is contained in:
parent
0a65a603d3
commit
b4ceaee622
@ -1,3 +1,8 @@
|
||||
2002-01-18 Andrew Cagney <ac131313@redhat.com>
|
||||
|
||||
* NEWS: Document that testsuite/gdb.hp/gdb.threads-hp/ is
|
||||
obsolete.
|
||||
|
||||
2002-01-18 Andrew Cagney <ac131313@redhat.com>
|
||||
|
||||
* infptrace.c: Remove ATTRIBUTE_UNUSED. Update copyright.
|
||||
|
1
gdb/NEWS
1
gdb/NEWS
@ -41,6 +41,7 @@ AMD 29000 embedded, using EBMON a29k-none-none
|
||||
AMD 29000 embedded with COFF a29k-none-coff
|
||||
AMD 29000 embedded with a.out a29k-none-aout
|
||||
|
||||
testsuite/gdb.hp/gdb.threads-hp/ directory
|
||||
|
||||
* REMOVED configurations and files
|
||||
|
||||
|
@ -1,3 +1,12 @@
|
||||
2002-01-18 Andrew Cagney <ac131313@redhat.com>
|
||||
|
||||
* gdb.hp/gdb.threads-hp/usrthfork.exp: Mark as obsolete.
|
||||
* gdb.hp/gdb.threads-hp/usrthcore.exp: Ditto.
|
||||
* gdb.hp/gdb.threads-hp/usrthbasic.exp: Ditto.
|
||||
* gdb.hp/gdb.threads-hp/usrthfork.c: Ditto.
|
||||
* gdb.hp/gdb.threads-hp/usrthbasic.c: Ditto.
|
||||
* gdb.hp/gdb.threads-hp/usrthcore.c: Ditto.
|
||||
|
||||
2002-01-17 Jim Blandy <jimb@redhat.com>
|
||||
|
||||
* gdb.asm/asm-source.exp (info symbol): Take another shot at
|
||||
|
@ -1,171 +1,171 @@
|
||||
#include <stdio.h>
|
||||
|
||||
/* #include "config.h" */
|
||||
#define HAVE_PTHREAD_H
|
||||
#define __hpux__
|
||||
#define __osf__
|
||||
|
||||
#ifndef HAVE_PTHREAD_H
|
||||
|
||||
/* Don't even try to compile. In fact, cause a syntax error that we can
|
||||
look for as a compiler error message and know that we have no pthread
|
||||
support. In that case we can just suppress the test completely. */
|
||||
|
||||
#error "no posix threads support"
|
||||
|
||||
#else
|
||||
|
||||
/* OK. We have the right header. If we try to compile this and fail, then
|
||||
there is something wrong and the user should know about it so the testsuite
|
||||
should issue an ERROR result.. */
|
||||
|
||||
#ifdef __linux__
|
||||
#define _MIT_POSIX_THREADS 1 /* Linux (or at least RedHat 4.0) needs this */
|
||||
#endif
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
/* Under OSF 2.0 & 3.0 and HPUX 10, the second arg of pthread_create
|
||||
is prototyped to be just a "pthread_attr_t", while under Solaris it
|
||||
is a "pthread_attr_t *". Arg! */
|
||||
|
||||
#if defined (__osf__) || defined (__hpux__)
|
||||
#define PTHREAD_CREATE_ARG2(arg) arg
|
||||
#define PTHREAD_CREATE_NULL_ARG2 null_attr
|
||||
static pthread_attr_t null_attr;
|
||||
#else
|
||||
#define PTHREAD_CREATE_ARG2(arg) &arg
|
||||
#define PTHREAD_CREATE_NULL_ARG2 NULL
|
||||
#endif
|
||||
|
||||
static int verbose = 0;
|
||||
|
||||
static void
|
||||
common_routine (arg)
|
||||
int arg;
|
||||
{
|
||||
static int from_thread1;
|
||||
static int from_thread2;
|
||||
static int from_main;
|
||||
static int hits;
|
||||
static int full_coverage;
|
||||
|
||||
if (verbose) printf("common_routine (%d)\n", arg);
|
||||
hits++;
|
||||
switch (arg)
|
||||
{
|
||||
case 0:
|
||||
from_main++;
|
||||
break;
|
||||
case 1:
|
||||
from_thread1++;
|
||||
break;
|
||||
case 2:
|
||||
from_thread2++;
|
||||
break;
|
||||
}
|
||||
if (from_main && from_thread1 && from_thread2)
|
||||
full_coverage = 1;
|
||||
}
|
||||
|
||||
static void *
|
||||
thread1 (void *arg)
|
||||
{
|
||||
int i;
|
||||
int z = 0;
|
||||
|
||||
if (verbose) printf ("thread1 (%0x) ; pid = %d\n", arg, getpid ());
|
||||
for (i=1; i <= 10000000; i++)
|
||||
{
|
||||
if (verbose) printf("thread1 %d\n", pthread_self ());
|
||||
z += i;
|
||||
common_routine (1);
|
||||
sleep(1);
|
||||
}
|
||||
}
|
||||
|
||||
static void *
|
||||
thread2 (void * arg)
|
||||
{
|
||||
int i;
|
||||
int k = 0;
|
||||
|
||||
if (verbose) printf ("thread2 (%0x) ; pid = %d\n", arg, getpid ());
|
||||
for (i=1; i <= 10000000; i++)
|
||||
{
|
||||
if (verbose) printf("thread2 %d\n", pthread_self ());
|
||||
k += i;
|
||||
common_routine (2);
|
||||
sleep(1);
|
||||
}
|
||||
sleep(100);
|
||||
}
|
||||
|
||||
int
|
||||
foo (a, b, c)
|
||||
int a, b, c;
|
||||
{
|
||||
int d, e, f;
|
||||
|
||||
if (verbose) printf("a=%d\n", a);
|
||||
}
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
pthread_t tid1, tid2;
|
||||
int j;
|
||||
int t = 0;
|
||||
void (*xxx) ();
|
||||
pthread_attr_t attr;
|
||||
|
||||
if (verbose) printf ("pid = %d\n", getpid());
|
||||
|
||||
foo (1, 2, 3);
|
||||
|
||||
#ifndef __osf__
|
||||
if (pthread_attr_init (&attr))
|
||||
{
|
||||
perror ("pthread_attr_init 1");
|
||||
exit (1);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PTHREAD_SCOPE_SYSTEM
|
||||
if (pthread_attr_setscope (&attr, PTHREAD_SCOPE_SYSTEM))
|
||||
{
|
||||
perror ("pthread_attr_setscope 1");
|
||||
exit (1);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (pthread_create (&tid1, pthread_attr_default, thread1, (void *) 0xfeedface))
|
||||
{
|
||||
perror ("pthread_create 1");
|
||||
exit (1);
|
||||
}
|
||||
if (verbose) printf ("Made thread %d\n", tid1);
|
||||
sleep (1);
|
||||
|
||||
if (pthread_create (&tid2, null_attr, thread2, (void *) 0xdeadbeef))
|
||||
{
|
||||
perror ("pthread_create 2");
|
||||
exit (1);
|
||||
}
|
||||
if (verbose) printf("Made thread %d\n", tid2);
|
||||
|
||||
sleep (1);
|
||||
|
||||
for (j = 1; j <= 10000000; j++)
|
||||
{
|
||||
if (verbose) printf("top %d\n", pthread_self ());
|
||||
common_routine (0);
|
||||
sleep(1);
|
||||
t += j;
|
||||
}
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
#endif /* ifndef HAVE_PTHREAD_H */
|
||||
/* OBSOLETE #include <stdio.h> */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* #include "config.h" */ */
|
||||
/* OBSOLETE #define HAVE_PTHREAD_H */
|
||||
/* OBSOLETE #define __hpux__ */
|
||||
/* OBSOLETE #define __osf__ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #ifndef HAVE_PTHREAD_H */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Don't even try to compile. In fact, cause a syntax error that we can */
|
||||
/* OBSOLETE look for as a compiler error message and know that we have no pthread */
|
||||
/* OBSOLETE support. In that case we can just suppress the test completely. */ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #error "no posix threads support" */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #else */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* OK. We have the right header. If we try to compile this and fail, then */
|
||||
/* OBSOLETE there is something wrong and the user should know about it so the testsuite */
|
||||
/* OBSOLETE should issue an ERROR result.. */ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #ifdef __linux__ */
|
||||
/* OBSOLETE #define _MIT_POSIX_THREADS 1 /* Linux (or at least RedHat 4.0) needs this */ */
|
||||
/* OBSOLETE #endif */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #include <pthread.h> */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Under OSF 2.0 & 3.0 and HPUX 10, the second arg of pthread_create */
|
||||
/* OBSOLETE is prototyped to be just a "pthread_attr_t", while under Solaris it */
|
||||
/* OBSOLETE is a "pthread_attr_t *". Arg! */ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #if defined (__osf__) || defined (__hpux__) */
|
||||
/* OBSOLETE #define PTHREAD_CREATE_ARG2(arg) arg */
|
||||
/* OBSOLETE #define PTHREAD_CREATE_NULL_ARG2 null_attr */
|
||||
/* OBSOLETE static pthread_attr_t null_attr; */
|
||||
/* OBSOLETE #else */
|
||||
/* OBSOLETE #define PTHREAD_CREATE_ARG2(arg) &arg */
|
||||
/* OBSOLETE #define PTHREAD_CREATE_NULL_ARG2 NULL */
|
||||
/* OBSOLETE #endif */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE static int verbose = 0; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE static void */
|
||||
/* OBSOLETE common_routine (arg) */
|
||||
/* OBSOLETE int arg; */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE static int from_thread1; */
|
||||
/* OBSOLETE static int from_thread2; */
|
||||
/* OBSOLETE static int from_main; */
|
||||
/* OBSOLETE static int hits; */
|
||||
/* OBSOLETE static int full_coverage; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE if (verbose) printf("common_routine (%d)\n", arg); */
|
||||
/* OBSOLETE hits++; */
|
||||
/* OBSOLETE switch (arg) */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE case 0: */
|
||||
/* OBSOLETE from_main++; */
|
||||
/* OBSOLETE break; */
|
||||
/* OBSOLETE case 1: */
|
||||
/* OBSOLETE from_thread1++; */
|
||||
/* OBSOLETE break; */
|
||||
/* OBSOLETE case 2: */
|
||||
/* OBSOLETE from_thread2++; */
|
||||
/* OBSOLETE break; */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE if (from_main && from_thread1 && from_thread2) */
|
||||
/* OBSOLETE full_coverage = 1; */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE static void * */
|
||||
/* OBSOLETE thread1 (void *arg) */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE int i; */
|
||||
/* OBSOLETE int z = 0; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE if (verbose) printf ("thread1 (%0x) ; pid = %d\n", arg, getpid ()); */
|
||||
/* OBSOLETE for (i=1; i <= 10000000; i++) */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE if (verbose) printf("thread1 %d\n", pthread_self ()); */
|
||||
/* OBSOLETE z += i; */
|
||||
/* OBSOLETE common_routine (1); */
|
||||
/* OBSOLETE sleep(1); */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE static void * */
|
||||
/* OBSOLETE thread2 (void * arg) */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE int i; */
|
||||
/* OBSOLETE int k = 0; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE if (verbose) printf ("thread2 (%0x) ; pid = %d\n", arg, getpid ()); */
|
||||
/* OBSOLETE for (i=1; i <= 10000000; i++) */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE if (verbose) printf("thread2 %d\n", pthread_self ()); */
|
||||
/* OBSOLETE k += i; */
|
||||
/* OBSOLETE common_routine (2); */
|
||||
/* OBSOLETE sleep(1); */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE sleep(100); */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE int */
|
||||
/* OBSOLETE foo (a, b, c) */
|
||||
/* OBSOLETE int a, b, c; */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE int d, e, f; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE if (verbose) printf("a=%d\n", a); */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE main(argc, argv) */
|
||||
/* OBSOLETE int argc; */
|
||||
/* OBSOLETE char **argv; */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE pthread_t tid1, tid2; */
|
||||
/* OBSOLETE int j; */
|
||||
/* OBSOLETE int t = 0; */
|
||||
/* OBSOLETE void (*xxx) (); */
|
||||
/* OBSOLETE pthread_attr_t attr; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE if (verbose) printf ("pid = %d\n", getpid()); */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE foo (1, 2, 3); */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #ifndef __osf__ */
|
||||
/* OBSOLETE if (pthread_attr_init (&attr)) */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE perror ("pthread_attr_init 1"); */
|
||||
/* OBSOLETE exit (1); */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE #endif */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #ifdef PTHREAD_SCOPE_SYSTEM */
|
||||
/* OBSOLETE if (pthread_attr_setscope (&attr, PTHREAD_SCOPE_SYSTEM)) */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE perror ("pthread_attr_setscope 1"); */
|
||||
/* OBSOLETE exit (1); */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE #endif */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE if (pthread_create (&tid1, pthread_attr_default, thread1, (void *) 0xfeedface)) */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE perror ("pthread_create 1"); */
|
||||
/* OBSOLETE exit (1); */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE if (verbose) printf ("Made thread %d\n", tid1); */
|
||||
/* OBSOLETE sleep (1); */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE if (pthread_create (&tid2, null_attr, thread2, (void *) 0xdeadbeef)) */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE perror ("pthread_create 2"); */
|
||||
/* OBSOLETE exit (1); */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE if (verbose) printf("Made thread %d\n", tid2); */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE sleep (1); */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE for (j = 1; j <= 10000000; j++) */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE if (verbose) printf("top %d\n", pthread_self ()); */
|
||||
/* OBSOLETE common_routine (0); */
|
||||
/* OBSOLETE sleep(1); */
|
||||
/* OBSOLETE t += j; */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE exit(0); */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #endif /* ifndef HAVE_PTHREAD_H */ */
|
||||
|
@ -1,110 +1,110 @@
|
||||
# usrthbasic.exp -- Expect script to test gdb with user threads
|
||||
# Copyright (C) 1992 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
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
# use this to debug:
|
||||
#
|
||||
#log_user 1
|
||||
|
||||
# OBSOLETE # usrthbasic.exp -- Expect script to test gdb with user threads
|
||||
# OBSOLETE # Copyright (C) 1992 Free Software Foundation, Inc.
|
||||
# OBSOLETE
|
||||
# OBSOLETE # This program is free software; you can redistribute it and/or modify
|
||||
# OBSOLETE # it under the terms of the GNU General Public License as published by
|
||||
# OBSOLETE # the Free Software Foundation; either version 2 of the License, or
|
||||
# OBSOLETE # (at your option) any later version.
|
||||
# OBSOLETE #
|
||||
# OBSOLETE # This program is distributed in the hope that it will be useful,
|
||||
# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# OBSOLETE # GNU General Public License for more details.
|
||||
# OBSOLETE #
|
||||
# OBSOLETE # You should have received a copy of the GNU General Public License
|
||||
# OBSOLETE # along with this program; if not, write to the Free Software
|
||||
# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
# OBSOLETE
|
||||
# OBSOLETE # Please email any bugs, comments, and/or additions to this file to:
|
||||
# OBSOLETE # bug-gdb@prep.ai.mit.edu
|
||||
# OBSOLETE
|
||||
# OBSOLETE # use this to debug:
|
||||
# OBSOLETE #
|
||||
# OBSOLETE #log_user 1
|
||||
# OBSOLETE
|
||||
verbose "HP's thread tests are broken beyond repair right now."
|
||||
return 0
|
||||
|
||||
if $tracelevel {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
if { [skip_hp_tests] } { continue }
|
||||
|
||||
if { ![istarget "hppa*-*-hpux*"] || [istarget "hppa64-*-*"] } {
|
||||
verbose "HPUX thread test ignored for non-hppa or PA64 targets."
|
||||
return 0
|
||||
}
|
||||
|
||||
set testfile usrthbasic
|
||||
set srcfile ${srcdir}/${subdir}/${testfile}.c
|
||||
set binfile ${srcdir}/${subdir}/${testfile}
|
||||
|
||||
# To build the executable we need to link against the thread library.
|
||||
#
|
||||
# /opt/ansic/bin/cc -Ae +DAportable -g -o usrthbasic -lcma usrthbasic.c
|
||||
#
|
||||
## we have trouble building it on 11.0, so we use the prebuilt
|
||||
## executable instead.
|
||||
##
|
||||
##if { [gdb_compile "${srcdir}/${subdir}/${testfile}.c" "${binfile}" executable {debug additional_flags=-Ae ldflags=-lcma}] != "" } {
|
||||
## gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
##}
|
||||
|
||||
# We don't really seem to need longer waits.
|
||||
#
|
||||
##set oldtimeout $timeout
|
||||
##set timeout [expr "$timeout + 0"]
|
||||
##set oldverbose $verbose
|
||||
##set verbose 40
|
||||
|
||||
#=========================
|
||||
#
|
||||
# Test looking at threads.
|
||||
#
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
gdb_test "b main" ".*Breakpoint 1.*" "b main"
|
||||
gdb_test "run" "Breakpoint 1, main.*:119.*" "run to main"
|
||||
gdb_test "b thread1" ".*Breakpoint 2.*" "b thread1"
|
||||
gdb_test "info threads" "\\* 1 system thread.*:119\[^(\]*" \
|
||||
"info threads at main"
|
||||
gdb_test "c" "Breakpoint 2, thread1.*" "continue to thread1"
|
||||
gdb_test "info threads" \
|
||||
"\\* 3 system thread.*thread1.*libcma.1.*libcma.1\[^(\]*" \
|
||||
"info threads at main"
|
||||
gdb_test "b 165" "Breakpoint 3.*165.*" "break at main counter"
|
||||
gdb_test "c" "Breakpoint 3, main.*" "continue to main counter"
|
||||
gdb_test "info threads" " 4 system thread.*\\* 1 system thread.*main.*" \
|
||||
"info threads at main counter"
|
||||
gdb_test "b 97" "Breakpoint 4.*97.*" "break at thread2 counter"
|
||||
gdb_test "b 81" "Breakpoint 5.*81.*" "break at thread1 counter"
|
||||
gdb_test "bt" "#0 main.* at \[^(\]*" "backtrace at main counter"
|
||||
|
||||
# After switching to thread 4, the cma scheduler should schedule it next
|
||||
# and we should hit its breakpoint in thread2.
|
||||
gdb_test "thread 4" ".Switching to thread 4.*cma__dispatch.*" \
|
||||
"switch to thread 4"
|
||||
gdb_test "bt" "#0 .*thread2.*" "backtrace at thread 4"
|
||||
sleep 1
|
||||
gdb_test "c" ".*Breakpoint 4, thread2.*" "continue and get to thread 4"
|
||||
|
||||
# After switching to thread 1, the cma scheduler should schedule it next
|
||||
# and we should hit its breakpoint (in main).
|
||||
gdb_test "thread 1" ".*Switching to thread 1.*cma__dispatch.*" \
|
||||
"switch to thread 1"
|
||||
sleep 1
|
||||
gdb_test "c" ".*Breakpoint 3, main.*usrthbasic.c:165.*" \
|
||||
"continue and get to thread 1"
|
||||
|
||||
# Done!
|
||||
#
|
||||
gdb_exit
|
||||
|
||||
##set timeout $oldtimeout
|
||||
##set verbose $oldverbose
|
||||
|
||||
return 0
|
||||
# OBSOLETE
|
||||
# OBSOLETE if $tracelevel {
|
||||
# OBSOLETE strace $tracelevel
|
||||
# OBSOLETE }
|
||||
# OBSOLETE
|
||||
# OBSOLETE if { [skip_hp_tests] } { continue }
|
||||
# OBSOLETE
|
||||
# OBSOLETE if { ![istarget "hppa*-*-hpux*"] || [istarget "hppa64-*-*"] } {
|
||||
# OBSOLETE verbose "HPUX thread test ignored for non-hppa or PA64 targets."
|
||||
# OBSOLETE return 0
|
||||
# OBSOLETE }
|
||||
# OBSOLETE
|
||||
# OBSOLETE set testfile usrthbasic
|
||||
# OBSOLETE set srcfile ${srcdir}/${subdir}/${testfile}.c
|
||||
# OBSOLETE set binfile ${srcdir}/${subdir}/${testfile}
|
||||
# OBSOLETE
|
||||
# OBSOLETE # To build the executable we need to link against the thread library.
|
||||
# OBSOLETE #
|
||||
# OBSOLETE # /opt/ansic/bin/cc -Ae +DAportable -g -o usrthbasic -lcma usrthbasic.c
|
||||
# OBSOLETE #
|
||||
# OBSOLETE ## we have trouble building it on 11.0, so we use the prebuilt
|
||||
# OBSOLETE ## executable instead.
|
||||
# OBSOLETE ##
|
||||
# OBSOLETE ##if { [gdb_compile "${srcdir}/${subdir}/${testfile}.c" "${binfile}" executable {debug additional_flags=-Ae ldflags=-lcma}] != "" } {
|
||||
# OBSOLETE ## gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
# OBSOLETE ##}
|
||||
# OBSOLETE
|
||||
# OBSOLETE # We don't really seem to need longer waits.
|
||||
# OBSOLETE #
|
||||
# OBSOLETE ##set oldtimeout $timeout
|
||||
# OBSOLETE ##set timeout [expr "$timeout + 0"]
|
||||
# OBSOLETE ##set oldverbose $verbose
|
||||
# OBSOLETE ##set verbose 40
|
||||
# OBSOLETE
|
||||
# OBSOLETE #=========================
|
||||
# OBSOLETE #
|
||||
# OBSOLETE # Test looking at threads.
|
||||
# OBSOLETE #
|
||||
# OBSOLETE gdb_exit
|
||||
# OBSOLETE gdb_start
|
||||
# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir
|
||||
# OBSOLETE gdb_load ${binfile}
|
||||
# OBSOLETE
|
||||
# OBSOLETE gdb_test "b main" ".*Breakpoint 1.*" "b main"
|
||||
# OBSOLETE gdb_test "run" "Breakpoint 1, main.*:119.*" "run to main"
|
||||
# OBSOLETE gdb_test "b thread1" ".*Breakpoint 2.*" "b thread1"
|
||||
# OBSOLETE gdb_test "info threads" "\\* 1 system thread.*:119\[^(\]*" \
|
||||
# OBSOLETE "info threads at main"
|
||||
# OBSOLETE gdb_test "c" "Breakpoint 2, thread1.*" "continue to thread1"
|
||||
# OBSOLETE gdb_test "info threads" \
|
||||
# OBSOLETE "\\* 3 system thread.*thread1.*libcma.1.*libcma.1\[^(\]*" \
|
||||
# OBSOLETE "info threads at main"
|
||||
# OBSOLETE gdb_test "b 165" "Breakpoint 3.*165.*" "break at main counter"
|
||||
# OBSOLETE gdb_test "c" "Breakpoint 3, main.*" "continue to main counter"
|
||||
# OBSOLETE gdb_test "info threads" " 4 system thread.*\\* 1 system thread.*main.*" \
|
||||
# OBSOLETE "info threads at main counter"
|
||||
# OBSOLETE gdb_test "b 97" "Breakpoint 4.*97.*" "break at thread2 counter"
|
||||
# OBSOLETE gdb_test "b 81" "Breakpoint 5.*81.*" "break at thread1 counter"
|
||||
# OBSOLETE gdb_test "bt" "#0 main.* at \[^(\]*" "backtrace at main counter"
|
||||
# OBSOLETE
|
||||
# OBSOLETE # After switching to thread 4, the cma scheduler should schedule it next
|
||||
# OBSOLETE # and we should hit its breakpoint in thread2.
|
||||
# OBSOLETE gdb_test "thread 4" ".Switching to thread 4.*cma__dispatch.*" \
|
||||
# OBSOLETE "switch to thread 4"
|
||||
# OBSOLETE gdb_test "bt" "#0 .*thread2.*" "backtrace at thread 4"
|
||||
# OBSOLETE sleep 1
|
||||
# OBSOLETE gdb_test "c" ".*Breakpoint 4, thread2.*" "continue and get to thread 4"
|
||||
# OBSOLETE
|
||||
# OBSOLETE # After switching to thread 1, the cma scheduler should schedule it next
|
||||
# OBSOLETE # and we should hit its breakpoint (in main).
|
||||
# OBSOLETE gdb_test "thread 1" ".*Switching to thread 1.*cma__dispatch.*" \
|
||||
# OBSOLETE "switch to thread 1"
|
||||
# OBSOLETE sleep 1
|
||||
# OBSOLETE gdb_test "c" ".*Breakpoint 3, main.*usrthbasic.c:165.*" \
|
||||
# OBSOLETE "continue and get to thread 1"
|
||||
# OBSOLETE
|
||||
# OBSOLETE # Done!
|
||||
# OBSOLETE #
|
||||
# OBSOLETE gdb_exit
|
||||
# OBSOLETE
|
||||
# OBSOLETE ##set timeout $oldtimeout
|
||||
# OBSOLETE ##set verbose $oldverbose
|
||||
# OBSOLETE
|
||||
# OBSOLETE return 0
|
||||
|
@ -1,177 +1,177 @@
|
||||
#include <stdio.h>
|
||||
|
||||
/* #include "config.h" */
|
||||
#define HAVE_PTHREAD_H
|
||||
#define __hpux__
|
||||
#define __osf__
|
||||
|
||||
#ifndef HAVE_PTHREAD_H
|
||||
|
||||
/* Don't even try to compile. In fact, cause a syntax error that we can
|
||||
look for as a compiler error message and know that we have no pthread
|
||||
support. In that case we can just suppress the test completely. */
|
||||
|
||||
#error "no posix threads support"
|
||||
|
||||
#else
|
||||
|
||||
/* OK. We have the right header. If we try to compile this and fail, then
|
||||
there is something wrong and the user should know about it so the testsuite
|
||||
should issue an ERROR result.. */
|
||||
|
||||
#ifdef __linux__
|
||||
#define _MIT_POSIX_THREADS 1 /* Linux (or at least RedHat 4.0) needs this */
|
||||
#endif
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
/* Under OSF 2.0 & 3.0 and HPUX 10, the second arg of pthread_create
|
||||
is prototyped to be just a "pthread_attr_t", while under Solaris it
|
||||
is a "pthread_attr_t *". Arg! */
|
||||
|
||||
#if defined (__osf__) || defined (__hpux__)
|
||||
#define PTHREAD_CREATE_ARG2(arg) arg
|
||||
#define PTHREAD_CREATE_NULL_ARG2 null_attr
|
||||
static pthread_attr_t null_attr;
|
||||
#else
|
||||
#define PTHREAD_CREATE_ARG2(arg) &arg
|
||||
#define PTHREAD_CREATE_NULL_ARG2 NULL
|
||||
#endif
|
||||
|
||||
static int verbose = 0;
|
||||
|
||||
static void
|
||||
common_routine (arg)
|
||||
int arg;
|
||||
{
|
||||
static int from_thread1;
|
||||
static int from_thread2;
|
||||
static int from_main;
|
||||
static int hits;
|
||||
static int full_coverage;
|
||||
|
||||
if (verbose) printf("common_routine (%d)\n", arg);
|
||||
hits++;
|
||||
switch (arg)
|
||||
{
|
||||
case 0:
|
||||
from_main++;
|
||||
break;
|
||||
case 1:
|
||||
from_thread1++;
|
||||
break;
|
||||
case 2:
|
||||
from_thread2++;
|
||||
break;
|
||||
}
|
||||
if (from_main && from_thread1 && from_thread2)
|
||||
full_coverage = 1;
|
||||
}
|
||||
|
||||
static void *
|
||||
thread1 (void *arg)
|
||||
{
|
||||
int i;
|
||||
int z = 0;
|
||||
|
||||
if (verbose) printf ("thread1 (%0x) ; pid = %d\n", arg, getpid ());
|
||||
for (i=1; i <= 10000000; i++)
|
||||
{
|
||||
if (verbose) printf("thread1 %d\n", pthread_self ());
|
||||
z += i;
|
||||
common_routine (1);
|
||||
sleep(1);
|
||||
}
|
||||
}
|
||||
|
||||
static void *
|
||||
thread2 (void * arg)
|
||||
{
|
||||
int i;
|
||||
int k = 0;
|
||||
|
||||
if (verbose) printf ("thread2 (%0x) ; pid = %d\n", arg, getpid ());
|
||||
for (i=1; i <= 10000000; i++)
|
||||
{
|
||||
if (verbose) printf("thread2 %d\n", pthread_self ());
|
||||
k += i;
|
||||
common_routine (2);
|
||||
sleep(1);
|
||||
}
|
||||
sleep(100);
|
||||
}
|
||||
|
||||
int
|
||||
foo (a, b, c)
|
||||
int a, b, c;
|
||||
{
|
||||
int d, e, f;
|
||||
|
||||
if (verbose) printf("a=%d\n", a);
|
||||
}
|
||||
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
pthread_t tid1, tid2;
|
||||
int j;
|
||||
int t = 0;
|
||||
void (*xxx) ();
|
||||
pthread_attr_t attr;
|
||||
|
||||
if (verbose) printf ("pid = %d\n", getpid());
|
||||
|
||||
foo (1, 2, 3);
|
||||
|
||||
#ifndef __osf__
|
||||
if (pthread_attr_init (&attr))
|
||||
{
|
||||
perror ("pthread_attr_init 1");
|
||||
exit (1);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef PTHREAD_SCOPE_SYSTEM
|
||||
if (pthread_attr_setscope (&attr, PTHREAD_SCOPE_SYSTEM))
|
||||
{
|
||||
perror ("pthread_attr_setscope 1");
|
||||
exit (1);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (pthread_create (&tid1, pthread_attr_default, thread1, (void *) 0xfeedface))
|
||||
{
|
||||
perror ("pthread_create 1");
|
||||
exit (1);
|
||||
}
|
||||
if (verbose) printf ("Made thread %d\n", tid1);
|
||||
sleep (1);
|
||||
|
||||
if (pthread_create (&tid2, null_attr, thread2, (void *) 0xdeadbeef))
|
||||
{
|
||||
perror ("pthread_create 2");
|
||||
exit (1);
|
||||
}
|
||||
if (verbose) printf("Made thread %d\n", tid2);
|
||||
|
||||
sleep (1);
|
||||
|
||||
for (j = 1; j <= 10000000; j++)
|
||||
{
|
||||
if (verbose) printf("top %d\n", pthread_self ());
|
||||
common_routine (0);
|
||||
sleep(1);
|
||||
t += j;
|
||||
if (j > 3)
|
||||
{
|
||||
int* int_p;
|
||||
int_p = 0;
|
||||
*int_p = 1;
|
||||
}
|
||||
}
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
#endif /* ifndef HAVE_PTHREAD_H */
|
||||
/* OBSOLETE #include <stdio.h> */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* #include "config.h" */ */
|
||||
/* OBSOLETE #define HAVE_PTHREAD_H */
|
||||
/* OBSOLETE #define __hpux__ */
|
||||
/* OBSOLETE #define __osf__ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #ifndef HAVE_PTHREAD_H */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Don't even try to compile. In fact, cause a syntax error that we can */
|
||||
/* OBSOLETE look for as a compiler error message and know that we have no pthread */
|
||||
/* OBSOLETE support. In that case we can just suppress the test completely. */ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #error "no posix threads support" */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #else */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* OK. We have the right header. If we try to compile this and fail, then */
|
||||
/* OBSOLETE there is something wrong and the user should know about it so the testsuite */
|
||||
/* OBSOLETE should issue an ERROR result.. */ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #ifdef __linux__ */
|
||||
/* OBSOLETE #define _MIT_POSIX_THREADS 1 /* Linux (or at least RedHat 4.0) needs this */ */
|
||||
/* OBSOLETE #endif */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #include <pthread.h> */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE /* Under OSF 2.0 & 3.0 and HPUX 10, the second arg of pthread_create */
|
||||
/* OBSOLETE is prototyped to be just a "pthread_attr_t", while under Solaris it */
|
||||
/* OBSOLETE is a "pthread_attr_t *". Arg! */ */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #if defined (__osf__) || defined (__hpux__) */
|
||||
/* OBSOLETE #define PTHREAD_CREATE_ARG2(arg) arg */
|
||||
/* OBSOLETE #define PTHREAD_CREATE_NULL_ARG2 null_attr */
|
||||
/* OBSOLETE static pthread_attr_t null_attr; */
|
||||
/* OBSOLETE #else */
|
||||
/* OBSOLETE #define PTHREAD_CREATE_ARG2(arg) &arg */
|
||||
/* OBSOLETE #define PTHREAD_CREATE_NULL_ARG2 NULL */
|
||||
/* OBSOLETE #endif */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE static int verbose = 0; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE static void */
|
||||
/* OBSOLETE common_routine (arg) */
|
||||
/* OBSOLETE int arg; */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE static int from_thread1; */
|
||||
/* OBSOLETE static int from_thread2; */
|
||||
/* OBSOLETE static int from_main; */
|
||||
/* OBSOLETE static int hits; */
|
||||
/* OBSOLETE static int full_coverage; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE if (verbose) printf("common_routine (%d)\n", arg); */
|
||||
/* OBSOLETE hits++; */
|
||||
/* OBSOLETE switch (arg) */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE case 0: */
|
||||
/* OBSOLETE from_main++; */
|
||||
/* OBSOLETE break; */
|
||||
/* OBSOLETE case 1: */
|
||||
/* OBSOLETE from_thread1++; */
|
||||
/* OBSOLETE break; */
|
||||
/* OBSOLETE case 2: */
|
||||
/* OBSOLETE from_thread2++; */
|
||||
/* OBSOLETE break; */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE if (from_main && from_thread1 && from_thread2) */
|
||||
/* OBSOLETE full_coverage = 1; */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE static void * */
|
||||
/* OBSOLETE thread1 (void *arg) */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE int i; */
|
||||
/* OBSOLETE int z = 0; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE if (verbose) printf ("thread1 (%0x) ; pid = %d\n", arg, getpid ()); */
|
||||
/* OBSOLETE for (i=1; i <= 10000000; i++) */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE if (verbose) printf("thread1 %d\n", pthread_self ()); */
|
||||
/* OBSOLETE z += i; */
|
||||
/* OBSOLETE common_routine (1); */
|
||||
/* OBSOLETE sleep(1); */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE static void * */
|
||||
/* OBSOLETE thread2 (void * arg) */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE int i; */
|
||||
/* OBSOLETE int k = 0; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE if (verbose) printf ("thread2 (%0x) ; pid = %d\n", arg, getpid ()); */
|
||||
/* OBSOLETE for (i=1; i <= 10000000; i++) */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE if (verbose) printf("thread2 %d\n", pthread_self ()); */
|
||||
/* OBSOLETE k += i; */
|
||||
/* OBSOLETE common_routine (2); */
|
||||
/* OBSOLETE sleep(1); */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE sleep(100); */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE int */
|
||||
/* OBSOLETE foo (a, b, c) */
|
||||
/* OBSOLETE int a, b, c; */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE int d, e, f; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE if (verbose) printf("a=%d\n", a); */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE main(argc, argv) */
|
||||
/* OBSOLETE int argc; */
|
||||
/* OBSOLETE char **argv; */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE pthread_t tid1, tid2; */
|
||||
/* OBSOLETE int j; */
|
||||
/* OBSOLETE int t = 0; */
|
||||
/* OBSOLETE void (*xxx) (); */
|
||||
/* OBSOLETE pthread_attr_t attr; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE if (verbose) printf ("pid = %d\n", getpid()); */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE foo (1, 2, 3); */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #ifndef __osf__ */
|
||||
/* OBSOLETE if (pthread_attr_init (&attr)) */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE perror ("pthread_attr_init 1"); */
|
||||
/* OBSOLETE exit (1); */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE #endif */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #ifdef PTHREAD_SCOPE_SYSTEM */
|
||||
/* OBSOLETE if (pthread_attr_setscope (&attr, PTHREAD_SCOPE_SYSTEM)) */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE perror ("pthread_attr_setscope 1"); */
|
||||
/* OBSOLETE exit (1); */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE #endif */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE if (pthread_create (&tid1, pthread_attr_default, thread1, (void *) 0xfeedface)) */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE perror ("pthread_create 1"); */
|
||||
/* OBSOLETE exit (1); */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE if (verbose) printf ("Made thread %d\n", tid1); */
|
||||
/* OBSOLETE sleep (1); */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE if (pthread_create (&tid2, null_attr, thread2, (void *) 0xdeadbeef)) */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE perror ("pthread_create 2"); */
|
||||
/* OBSOLETE exit (1); */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE if (verbose) printf("Made thread %d\n", tid2); */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE sleep (1); */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE for (j = 1; j <= 10000000; j++) */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE if (verbose) printf("top %d\n", pthread_self ()); */
|
||||
/* OBSOLETE common_routine (0); */
|
||||
/* OBSOLETE sleep(1); */
|
||||
/* OBSOLETE t += j; */
|
||||
/* OBSOLETE if (j > 3) */
|
||||
/* OBSOLETE { */
|
||||
/* OBSOLETE int* int_p; */
|
||||
/* OBSOLETE int_p = 0; */
|
||||
/* OBSOLETE *int_p = 1; */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE exit(0); */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE #endif /* ifndef HAVE_PTHREAD_H */ */
|
||||
|
@ -1,92 +1,92 @@
|
||||
# usrthcore.exp -- Expect script to test gdb with user threads
|
||||
# Copyright (C) 1992 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
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
# use this to debug:
|
||||
#
|
||||
#log_user 1
|
||||
|
||||
# OBSOLETE # usrthcore.exp -- Expect script to test gdb with user threads
|
||||
# OBSOLETE # Copyright (C) 1992 Free Software Foundation, Inc.
|
||||
# OBSOLETE
|
||||
# OBSOLETE # This program is free software; you can redistribute it and/or modify
|
||||
# OBSOLETE # it under the terms of the GNU General Public License as published by
|
||||
# OBSOLETE # the Free Software Foundation; either version 2 of the License, or
|
||||
# OBSOLETE # (at your option) any later version.
|
||||
# OBSOLETE #
|
||||
# OBSOLETE # This program is distributed in the hope that it will be useful,
|
||||
# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# OBSOLETE # GNU General Public License for more details.
|
||||
# OBSOLETE #
|
||||
# OBSOLETE # You should have received a copy of the GNU General Public License
|
||||
# OBSOLETE # along with this program; if not, write to the Free Software
|
||||
# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
# OBSOLETE
|
||||
# OBSOLETE # Please email any bugs, comments, and/or additions to this file to:
|
||||
# OBSOLETE # bug-gdb@prep.ai.mit.edu
|
||||
# OBSOLETE
|
||||
# OBSOLETE # use this to debug:
|
||||
# OBSOLETE #
|
||||
# OBSOLETE #log_user 1
|
||||
# OBSOLETE
|
||||
verbose "HP's thread tests are broken beyond repair right now."
|
||||
return 0
|
||||
|
||||
if $tracelevel {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
if { [skip_hp_tests] } { continue }
|
||||
|
||||
if { ![istarget "hppa*-*-hpux*"] || [istarget "hppa64-*-*"] } {
|
||||
verbose "HPUX thread test ignored for non-hppa or PA64 targets."
|
||||
return 0
|
||||
}
|
||||
|
||||
set testfile usrthcore
|
||||
set srcfile ${srcdir}/${subdir}/${testfile}.c
|
||||
set binfile ${srcdir}/${subdir}/${testfile}
|
||||
|
||||
# To build the executable we need to link against the thread library.
|
||||
#
|
||||
# /opt/ansic/bin/cc -Ae +DAportable -g -o usrthcore -lcma usrthcore.c
|
||||
#
|
||||
## we have trouble building it on 11.0, so we use the prebuilt
|
||||
## executable instead.
|
||||
##
|
||||
##if { [gdb_compile "${srcdir}/${subdir}/${testfile}.c -lcma" "${binfile}" executable {debug additional_flags=-Ae ldflags=-lcma}] != "" } {
|
||||
## gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
##}
|
||||
|
||||
#=========================
|
||||
#
|
||||
# Test looking at threads in a core file
|
||||
#
|
||||
|
||||
remote_exec build "rm -f core"
|
||||
remote_exec build "${binfile}"
|
||||
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
gdb_test "core-file core" \
|
||||
".*Core was generated by `usrthcore'.*in main.*usrthcore.c:170.*" \
|
||||
"load corefile"
|
||||
|
||||
gdb_test "info thread" \
|
||||
" 4 .*cma__dispatch.*\\* 1 .*in main.*usrthcore.c:170.*" \
|
||||
"info thread on core file"
|
||||
gdb_test "bt" "#0.*in main.*usrthcore.c:170" "backtrace on active thread"
|
||||
gdb_test "thread 4" ".*Switching to thread 4.*cma__dispatch.*" \
|
||||
"switch to thread 4 (thread2 procedure)"
|
||||
gdb_test "bt" "#0.*cma__dispatch.*thread2.*usrthcore.c:99.*" \
|
||||
"Backtrace on inactive thread (thread2 procedure)"
|
||||
gdb_test "b thread1" "Breakpoint 1.*usrthcore.c, line 75.*" \
|
||||
"break on thread1"
|
||||
gdb_test "run" "Starting program.*Breakpoint 1, thread1.*usrthcore.c:75.*" \
|
||||
"run program, get to thread1 procedure"
|
||||
gdb_test "info threads" "\\* \[23\] .*thread1.* 1 .*cma__dispatch.*" \
|
||||
"info threads after running core"
|
||||
|
||||
|
||||
# Done!
|
||||
#
|
||||
gdb_exit
|
||||
|
||||
remote_exec build "rm -f core"
|
||||
|
||||
return 0
|
||||
# OBSOLETE
|
||||
# OBSOLETE if $tracelevel {
|
||||
# OBSOLETE strace $tracelevel
|
||||
# OBSOLETE }
|
||||
# OBSOLETE
|
||||
# OBSOLETE if { [skip_hp_tests] } { continue }
|
||||
# OBSOLETE
|
||||
# OBSOLETE if { ![istarget "hppa*-*-hpux*"] || [istarget "hppa64-*-*"] } {
|
||||
# OBSOLETE verbose "HPUX thread test ignored for non-hppa or PA64 targets."
|
||||
# OBSOLETE return 0
|
||||
# OBSOLETE }
|
||||
# OBSOLETE
|
||||
# OBSOLETE set testfile usrthcore
|
||||
# OBSOLETE set srcfile ${srcdir}/${subdir}/${testfile}.c
|
||||
# OBSOLETE set binfile ${srcdir}/${subdir}/${testfile}
|
||||
# OBSOLETE
|
||||
# OBSOLETE # To build the executable we need to link against the thread library.
|
||||
# OBSOLETE #
|
||||
# OBSOLETE # /opt/ansic/bin/cc -Ae +DAportable -g -o usrthcore -lcma usrthcore.c
|
||||
# OBSOLETE #
|
||||
# OBSOLETE ## we have trouble building it on 11.0, so we use the prebuilt
|
||||
# OBSOLETE ## executable instead.
|
||||
# OBSOLETE ##
|
||||
# OBSOLETE ##if { [gdb_compile "${srcdir}/${subdir}/${testfile}.c -lcma" "${binfile}" executable {debug additional_flags=-Ae ldflags=-lcma}] != "" } {
|
||||
# OBSOLETE ## gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
# OBSOLETE ##}
|
||||
# OBSOLETE
|
||||
# OBSOLETE #=========================
|
||||
# OBSOLETE #
|
||||
# OBSOLETE # Test looking at threads in a core file
|
||||
# OBSOLETE #
|
||||
# OBSOLETE
|
||||
# OBSOLETE remote_exec build "rm -f core"
|
||||
# OBSOLETE remote_exec build "${binfile}"
|
||||
# OBSOLETE
|
||||
# OBSOLETE gdb_exit
|
||||
# OBSOLETE gdb_start
|
||||
# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir
|
||||
# OBSOLETE gdb_load ${binfile}
|
||||
# OBSOLETE gdb_test "core-file core" \
|
||||
# OBSOLETE ".*Core was generated by `usrthcore'.*in main.*usrthcore.c:170.*" \
|
||||
# OBSOLETE "load corefile"
|
||||
# OBSOLETE
|
||||
# OBSOLETE gdb_test "info thread" \
|
||||
# OBSOLETE " 4 .*cma__dispatch.*\\* 1 .*in main.*usrthcore.c:170.*" \
|
||||
# OBSOLETE "info thread on core file"
|
||||
# OBSOLETE gdb_test "bt" "#0.*in main.*usrthcore.c:170" "backtrace on active thread"
|
||||
# OBSOLETE gdb_test "thread 4" ".*Switching to thread 4.*cma__dispatch.*" \
|
||||
# OBSOLETE "switch to thread 4 (thread2 procedure)"
|
||||
# OBSOLETE gdb_test "bt" "#0.*cma__dispatch.*thread2.*usrthcore.c:99.*" \
|
||||
# OBSOLETE "Backtrace on inactive thread (thread2 procedure)"
|
||||
# OBSOLETE gdb_test "b thread1" "Breakpoint 1.*usrthcore.c, line 75.*" \
|
||||
# OBSOLETE "break on thread1"
|
||||
# OBSOLETE gdb_test "run" "Starting program.*Breakpoint 1, thread1.*usrthcore.c:75.*" \
|
||||
# OBSOLETE "run program, get to thread1 procedure"
|
||||
# OBSOLETE gdb_test "info threads" "\\* \[23\] .*thread1.* 1 .*cma__dispatch.*" \
|
||||
# OBSOLETE "info threads after running core"
|
||||
# OBSOLETE
|
||||
# OBSOLETE
|
||||
# OBSOLETE # Done!
|
||||
# OBSOLETE #
|
||||
# OBSOLETE gdb_exit
|
||||
# OBSOLETE
|
||||
# OBSOLETE remote_exec build "rm -f core"
|
||||
# OBSOLETE
|
||||
# OBSOLETE return 0
|
||||
|
@ -1,17 +1,17 @@
|
||||
#include <stdio.h>
|
||||
#include <pthread.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
int main(void){
|
||||
pid_t pid;
|
||||
|
||||
switch (pid = fork()){
|
||||
case 0:
|
||||
printf("child\n");
|
||||
break;
|
||||
default:
|
||||
printf("parent\n");
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
/* OBSOLETE #include <stdio.h> */
|
||||
/* OBSOLETE #include <pthread.h> */
|
||||
/* OBSOLETE #include <sys/types.h> */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE int main(void){ */
|
||||
/* OBSOLETE pid_t pid; */
|
||||
/* OBSOLETE */
|
||||
/* OBSOLETE switch (pid = fork()){ */
|
||||
/* OBSOLETE case 0: */
|
||||
/* OBSOLETE printf("child\n"); */
|
||||
/* OBSOLETE break; */
|
||||
/* OBSOLETE default: */
|
||||
/* OBSOLETE printf("parent\n"); */
|
||||
/* OBSOLETE break; */
|
||||
/* OBSOLETE } */
|
||||
/* OBSOLETE return 0; */
|
||||
/* OBSOLETE } */
|
||||
|
@ -1,75 +1,75 @@
|
||||
# user_th_basic.exp -- Expect script to test gdb with user threads
|
||||
# Copyright (C) 1992 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
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
# Please email any bugs, comments, and/or additions to this file to:
|
||||
# bug-gdb@prep.ai.mit.edu
|
||||
|
||||
# OBSOLETE # user_th_basic.exp -- Expect script to test gdb with user threads
|
||||
# OBSOLETE # Copyright (C) 1992 Free Software Foundation, Inc.
|
||||
# OBSOLETE
|
||||
# OBSOLETE # This program is free software; you can redistribute it and/or modify
|
||||
# OBSOLETE # it under the terms of the GNU General Public License as published by
|
||||
# OBSOLETE # the Free Software Foundation; either version 2 of the License, or
|
||||
# OBSOLETE # (at your option) any later version.
|
||||
# OBSOLETE #
|
||||
# OBSOLETE # This program is distributed in the hope that it will be useful,
|
||||
# OBSOLETE # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# OBSOLETE # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# OBSOLETE # GNU General Public License for more details.
|
||||
# OBSOLETE #
|
||||
# OBSOLETE # You should have received a copy of the GNU General Public License
|
||||
# OBSOLETE # along with this program; if not, write to the Free Software
|
||||
# OBSOLETE # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
# OBSOLETE
|
||||
# OBSOLETE # Please email any bugs, comments, and/or additions to this file to:
|
||||
# OBSOLETE # bug-gdb@prep.ai.mit.edu
|
||||
# OBSOLETE
|
||||
verbose "HP's thread tests are broken beyond repair right now."
|
||||
return 0
|
||||
|
||||
if $tracelevel {
|
||||
strace $tracelevel
|
||||
}
|
||||
|
||||
if { ![istarget "hppa*-*-hpux*"] || [istarget "hppa64-*-*"] } {
|
||||
verbose "HPUX thread test ignored for non-hppa or PA64 targets."
|
||||
return 0
|
||||
}
|
||||
|
||||
set testfile usrthfork
|
||||
set srcfile ${srcdir}/${subdir}/${testfile}.c
|
||||
set binfile ${srcdir}/${subdir}/${testfile}
|
||||
|
||||
# To build the executable we need to link against the thread library.
|
||||
#
|
||||
# /opt/ansic/bin/cc -Ae -g -o usrthfork -lcma usrthfork.c
|
||||
#
|
||||
## we have trouble building it on 11.0, so we use the prebuilt
|
||||
## executable instead.
|
||||
##
|
||||
##if { [gdb_compile "${srcdir}/${subdir}/${testfile}.c" "${binfile}" executable {debug additional_flags=-Ae ldflags=-lcma}] != "" } {
|
||||
## gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
##}
|
||||
|
||||
#=========================
|
||||
#
|
||||
# Test looking at threads.
|
||||
#
|
||||
gdb_exit
|
||||
gdb_start
|
||||
gdb_reinitialize_dir $srcdir/$subdir
|
||||
gdb_load ${binfile}
|
||||
|
||||
gdb_test "set follow-fork-mode parent" ".*" "set follow-fork-mode parent"
|
||||
gdb_test "b main" "Breakpoint 1.*" "b main"
|
||||
gdb_test "run" "Breakpoint 1, main.*:8.*" "run to main"
|
||||
##gdb_test "next" \
|
||||
## ".*New process.*Detaching after fork from process.*13.*parent.*" \
|
||||
## "next on CMA fork"
|
||||
send_gdb "next\n"
|
||||
gdb_expect {
|
||||
-re ".*Detaching after fork from.*$gdb_prompt $" {
|
||||
pass "next on CMA fork"
|
||||
}
|
||||
-re ".*$gdb_prompt $" { fail "next on CMA fork" }
|
||||
timeout { fail "(timeout) next on CMA fork" }
|
||||
}
|
||||
exec sleep 1
|
||||
|
||||
gdb_exit
|
||||
|
||||
return 0
|
||||
# OBSOLETE
|
||||
# OBSOLETE if $tracelevel {
|
||||
# OBSOLETE strace $tracelevel
|
||||
# OBSOLETE }
|
||||
# OBSOLETE
|
||||
# OBSOLETE if { ![istarget "hppa*-*-hpux*"] || [istarget "hppa64-*-*"] } {
|
||||
# OBSOLETE verbose "HPUX thread test ignored for non-hppa or PA64 targets."
|
||||
# OBSOLETE return 0
|
||||
# OBSOLETE }
|
||||
# OBSOLETE
|
||||
# OBSOLETE set testfile usrthfork
|
||||
# OBSOLETE set srcfile ${srcdir}/${subdir}/${testfile}.c
|
||||
# OBSOLETE set binfile ${srcdir}/${subdir}/${testfile}
|
||||
# OBSOLETE
|
||||
# OBSOLETE # To build the executable we need to link against the thread library.
|
||||
# OBSOLETE #
|
||||
# OBSOLETE # /opt/ansic/bin/cc -Ae -g -o usrthfork -lcma usrthfork.c
|
||||
# OBSOLETE #
|
||||
# OBSOLETE ## we have trouble building it on 11.0, so we use the prebuilt
|
||||
# OBSOLETE ## executable instead.
|
||||
# OBSOLETE ##
|
||||
# OBSOLETE ##if { [gdb_compile "${srcdir}/${subdir}/${testfile}.c" "${binfile}" executable {debug additional_flags=-Ae ldflags=-lcma}] != "" } {
|
||||
# OBSOLETE ## gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
|
||||
# OBSOLETE ##}
|
||||
# OBSOLETE
|
||||
# OBSOLETE #=========================
|
||||
# OBSOLETE #
|
||||
# OBSOLETE # Test looking at threads.
|
||||
# OBSOLETE #
|
||||
# OBSOLETE gdb_exit
|
||||
# OBSOLETE gdb_start
|
||||
# OBSOLETE gdb_reinitialize_dir $srcdir/$subdir
|
||||
# OBSOLETE gdb_load ${binfile}
|
||||
# OBSOLETE
|
||||
# OBSOLETE gdb_test "set follow-fork-mode parent" ".*" "set follow-fork-mode parent"
|
||||
# OBSOLETE gdb_test "b main" "Breakpoint 1.*" "b main"
|
||||
# OBSOLETE gdb_test "run" "Breakpoint 1, main.*:8.*" "run to main"
|
||||
# OBSOLETE ##gdb_test "next" \
|
||||
# OBSOLETE ## ".*New process.*Detaching after fork from process.*13.*parent.*" \
|
||||
# OBSOLETE ## "next on CMA fork"
|
||||
# OBSOLETE send_gdb "next\n"
|
||||
# OBSOLETE gdb_expect {
|
||||
# OBSOLETE -re ".*Detaching after fork from.*$gdb_prompt $" {
|
||||
# OBSOLETE pass "next on CMA fork"
|
||||
# OBSOLETE }
|
||||
# OBSOLETE -re ".*$gdb_prompt $" { fail "next on CMA fork" }
|
||||
# OBSOLETE timeout { fail "(timeout) next on CMA fork" }
|
||||
# OBSOLETE }
|
||||
# OBSOLETE exec sleep 1
|
||||
# OBSOLETE
|
||||
# OBSOLETE gdb_exit
|
||||
# OBSOLETE
|
||||
# OBSOLETE return 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user