This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] kfail mi-catch-load.exp on Windows


Hi,
mi-catch-load.c can't be compiled successfully on Windows,

  fatal error: dlfcn.h: No such file or directory

with the patch to mi-catch-load.c, it can be compiled.  However, there
are two fails:

  FAIL: gdb.mi/mi-catch-load.exp: catch-load: solib-event stop
  FAIL: gdb.mi/mi-catch-load.exp: catch-unload: solib-event stop

I didn't triage the fails.  I opened PR mi/15945 for them, and update
mi-catch-load.exp to link with the PR.

gdb/testsuite:

2013-09-12  Yao Qi  <yao@codesourcery.com>

	* gdb.mi/mi-catch-load.c: Remove the include of "dlfcn.h".
	 [__WIN32__]: Include "windows.h" and define macro 'dlopen'
	 and 'dlclose'.
	[!__WIN32__]: Include "dlfcn.h".
	* gdb.mi/mi-catch-load.exp: Set up kfail.
---
 gdb/testsuite/gdb.mi/mi-catch-load.c   |    9 ++++++++-
 gdb/testsuite/gdb.mi/mi-catch-load.exp |    2 ++
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/gdb/testsuite/gdb.mi/mi-catch-load.c b/gdb/testsuite/gdb.mi/mi-catch-load.c
index 83efda8..8fa45ad 100644
--- a/gdb/testsuite/gdb.mi/mi-catch-load.c
+++ b/gdb/testsuite/gdb.mi/mi-catch-load.c
@@ -15,9 +15,16 @@
    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 <stdio.h>
 
+#ifdef __WIN32__
+#include <windows.h>
+#define dlopen(name, mode) LoadLibrary (TEXT (name))
+#define dlclose(handle) FreeLibrary (handle)
+#else
+#include <dlfcn.h>
+#endif
+
 char *libname = "mi-catch-load-so.so";
 
 int
diff --git a/gdb/testsuite/gdb.mi/mi-catch-load.exp b/gdb/testsuite/gdb.mi/mi-catch-load.exp
index 64c1f11..c9acf0a 100644
--- a/gdb/testsuite/gdb.mi/mi-catch-load.exp
+++ b/gdb/testsuite/gdb.mi/mi-catch-load.exp
@@ -58,6 +58,7 @@ gdb_expect {
         pass "catch-load: solib-event stop"
     }
     -re ".*$mi_gdb_prompt$" {
+	setup_kfail gdb/15945 *-*-*mingw*
         fail "catch-load: solib-event stop"
     }
     timeout {
@@ -85,6 +86,7 @@ gdb_expect {
         pass "catch-unload: solib-event stop"
     }
     -re ".*$mi_gdb_prompt$" {
+	setup_kfail gdb/15945 *-*-*mingw*
         fail "catch-unload: solib-event stop"
     }
     timeout {
-- 
1.7.7.6


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]