aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.threads/dlopen-libpthread.c
diff options
context:
space:
mode:
authorGary Benson <gary@redhat.com>2013-06-04 13:23:32 +0000
committerGary Benson <gary@redhat.com>2013-06-04 13:23:32 +0000
commita29a3fb7a350b70ec755b1964d2830094314dba8 (patch)
tree3ecf57a2d1fb5000c36d5594dacd5cef81a9224b /gdb/testsuite/gdb.threads/dlopen-libpthread.c
parentf9e148520a52325c43e325984cd1cfea952b8ad8 (diff)
downloadbinutils-a29a3fb7a350b70ec755b1964d2830094314dba8.zip
binutils-a29a3fb7a350b70ec755b1964d2830094314dba8.tar.gz
binutils-a29a3fb7a350b70ec755b1964d2830094314dba8.tar.bz2
2013-06-04 Jan Kratochvil <jan.kratochvil@redhat.com>
Gary Benson <gbenson@redhat.com> * lib/gdb.exp (build_executable_from_specs): Use gdb_compile_pthread, gdb_compile_shlib or gdb_compile_shlib_pthreads where appropriate. * lib/prelink-support.exp (build_executable_own_libs): Allow INTERP to be set to "no" to indicate that no ld.so copy should be made. * gdb.base/break-interp.exp (solib_bp): New constant. (reach_1): Use the above instead of "_dl_debug_state". (test_attach): Likewise. (test_ld): Likewise. * gdb.threads/dlopen-libpthread.exp: New file. * gdb.threads/dlopen-libpthread.c: Likewise. * gdb.threads/dlopen-libpthread-lib.c: Likewise. * gdb.base/solib-corrupted.exp: Disable test if GDB is using probes.
Diffstat (limited to 'gdb/testsuite/gdb.threads/dlopen-libpthread.c')
-rw-r--r--gdb/testsuite/gdb.threads/dlopen-libpthread.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.threads/dlopen-libpthread.c b/gdb/testsuite/gdb.threads/dlopen-libpthread.c
new file mode 100644
index 0000000..7d6c00e
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/dlopen-libpthread.c
@@ -0,0 +1,46 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2011-2013 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 3 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, see <http://www.gnu.org/licenses/>. */
+
+#include <dlfcn.h>
+#include <stddef.h>
+#include <assert.h>
+
+static const char *volatile filename;
+
+static void
+notify (void)
+{
+ filename = NULL; /* notify-here */
+}
+
+int
+main (void)
+{
+ void *h;
+ void (*fp) (void (*) (void));
+
+ assert (filename != NULL);
+ h = dlopen (filename, RTLD_LAZY);
+ assert (h != NULL);
+
+ fp = dlsym (h, "f");
+ assert (fp != NULL);
+
+ fp (notify);
+
+ return 0;
+}