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

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