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

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