Blame SOURCES/gdb-6.3-bz202689-exec-from-pthread-test.patch

e1d87d
2007-01-17  Jan Kratochvil <jan.kratochvil@redhat.com>
e1d87d
e1d87d
	* gdb.threads/threaded-exec.exp, gdb.threads/threaded-exec.c: New files.
e1d87d
e1d87d
e1d87d
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threaded-exec.c
e1d87d
===================================================================
e1d87d
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
e1d87d
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threaded-exec.c	2016-02-16 09:54:06.936904418 +0100
e1d87d
@@ -0,0 +1,46 @@
e1d87d
+/* This testcase is part of GDB, the GNU debugger.
e1d87d
+
e1d87d
+   Copyright 2007 Free Software Foundation, Inc.
e1d87d
+
e1d87d
+   This program is free software; you can redistribute it and/or modify
e1d87d
+   it under the terms of the GNU General Public License as published by
e1d87d
+   the Free Software Foundation; either version 2 of the License, or
e1d87d
+   (at your option) any later version.
e1d87d
+
e1d87d
+   This program is distributed in the hope that it will be useful,
e1d87d
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
e1d87d
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
e1d87d
+   GNU General Public License for more details.
e1d87d
+
e1d87d
+   You should have received a copy of the GNU General Public License
e1d87d
+   along with this program; if not, write to the Free Software
e1d87d
+   Foundation, Inc., 59 Temple Place - Suite 330,
e1d87d
+   Boston, MA 02111-1307, USA.  */
e1d87d
+
e1d87d
+#include <stddef.h>
e1d87d
+#include <pthread.h>
e1d87d
+#include <assert.h>
e1d87d
+#include <stdlib.h>
e1d87d
+#include <unistd.h>
e1d87d
+
e1d87d
+
e1d87d
+static void *
e1d87d
+threader (void *arg)
e1d87d
+{
e1d87d
+	return NULL;
e1d87d
+}
e1d87d
+
e1d87d
+int
e1d87d
+main (void)
e1d87d
+{
e1d87d
+	pthread_t t1;
e1d87d
+	int i;
e1d87d
+
e1d87d
+	i = pthread_create (&t1, NULL, threader, (void *) NULL);
e1d87d
+	assert (i == 0);
e1d87d
+	i = pthread_join (t1, NULL);
e1d87d
+	assert (i == 0);
e1d87d
+
e1d87d
+	execl ("/bin/true", "/bin/true", NULL);
e1d87d
+	abort ();
e1d87d
+}
e1d87d
Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threaded-exec.exp
e1d87d
===================================================================
e1d87d
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
e1d87d
+++ gdb-7.10.90.20160211/gdb/testsuite/gdb.threads/threaded-exec.exp	2016-02-16 09:54:19.965992585 +0100
e1d87d
@@ -0,0 +1,41 @@
e1d87d
+# threaded-exec.exp -- Check reset of the tracked threads on exec*(2)
e1d87d
+# Copyright (C) 2007 Free Software Foundation, Inc.
e1d87d
+
e1d87d
+# This program is free software; you can redistribute it and/or modify
e1d87d
+# it under the terms of the GNU General Public License as published by
e1d87d
+# the Free Software Foundation; either version 2 of the License, or
e1d87d
+# (at your option) any later version.
e1d87d
+# 
e1d87d
+# This program is distributed in the hope that it will be useful,
e1d87d
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
e1d87d
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
e1d87d
+# GNU General Public License for more details.
e1d87d
+# 
e1d87d
+# You should have received a copy of the GNU General Public License
e1d87d
+# along with this program; if not, write to the Free Software
e1d87d
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
e1d87d
+
e1d87d
+# Please email any bugs, comments, and/or additions to this file to:
e1d87d
+# bug-gdb@prep.ai.mit.edu
e1d87d
+
e1d87d
+set testfile threaded-exec
e1d87d
+set srcfile ${testfile}.c
e1d87d
+set binfile [standard_output_file ${testfile}]
e1d87d
+
e1d87d
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable []] != "" } {
e1d87d
+    return -1
e1d87d
+}
e1d87d
+
e1d87d
+gdb_exit
e1d87d
+gdb_start
e1d87d
+gdb_reinitialize_dir $srcdir/$subdir
e1d87d
+
e1d87d
+gdb_load ${binfile}
e1d87d
+
e1d87d
+gdb_run_cmd
e1d87d
+
e1d87d
+gdb_test_multiple {} "Program exited" {
e1d87d
+   -re "\r\n\\\[Inferior .* exited normally\\\]\r\n$gdb_prompt $" {
e1d87d
+       pass "Program exited"
e1d87d
+   }
e1d87d
+}