Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Unified Diff: gdb/testsuite/gdb.threads/dlopen-libpthread.c

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/testsuite/gdb.threads/current-lwp-dead.exp ('k') | gdb/testsuite/gdb.threads/dlopen-libpthread.exp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/testsuite/gdb.threads/dlopen-libpthread.c
diff --git a/gdb/testsuite/gdb.cp/infcall-dlopen.cc b/gdb/testsuite/gdb.threads/dlopen-libpthread.c
similarity index 67%
copy from gdb/testsuite/gdb.cp/infcall-dlopen.cc
copy to gdb/testsuite/gdb.threads/dlopen-libpthread.c
index 024eb046c0dbd47a1e0015361f006961654e5376..7d6c00e2a15eec75f37b90eb844cfabe4833bc32 100644
--- a/gdb/testsuite/gdb.cp/infcall-dlopen.cc
+++ b/gdb/testsuite/gdb.threads/dlopen-libpthread.c
@@ -1,6 +1,6 @@
/* This testcase is part of GDB, the GNU debugger.
- Copyright 2010-2012 Free Software Foundation, Inc.
+ 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
@@ -17,27 +17,30 @@
#include <dlfcn.h>
#include <stddef.h>
+#include <assert.h>
-static int
-openlib (const char *filename)
-{
- void *h = dlopen (filename, RTLD_LAZY);
-
- if (filename == NULL)
- return 0;
+static const char *volatile filename;
- if (h == NULL)
- return 0;
- if (dlclose (h) != 0)
- return 0;
- return 1;
+static void
+notify (void)
+{
+ filename = NULL; /* notify-here */
}
int
main (void)
{
- /* Dummy call to get the function always compiled in. */
- openlib (NULL);
+ 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;
}
« no previous file with comments | « gdb/testsuite/gdb.threads/current-lwp-dead.exp ('k') | gdb/testsuite/gdb.threads/dlopen-libpthread.exp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698