Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Run catch-load.exp on Windows
@ 2013-09-12  1:00 Yao Qi
  2013-09-12  2:44 ` Eli Zaretskii
  2013-09-16 14:22 ` Pedro Alves
  0 siblings, 2 replies; 9+ messages in thread
From: Yao Qi @ 2013-09-12  1:00 UTC (permalink / raw)
  To: gdb-patches

Hi,
I find a compilation error when catch-load.c is compiled.

 catch-load.c:18:19: fatal error: dlfcn.h: No such file or directory

This patch is to fix this compilation error.  With this patch applied,
test case can be compiled successfully.  However, there is one fail
caused by matching "/" in file name, which doesn't exist on Windows.
This patch fixes it by matching either "/" or "\" in file name.

gdb/testsuite:

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

	* gdb.base/catch-load.c: Remove the include of "dlfcn.h".
	 [__WIN32__]: Include "windows.h" and define macro dlopen
	 and dlclose.
	[!__WIN32__]: Include "dlfcn.h".
	* gdb.base/catch-load.exp (one_catch_load_test): Match
	directory separator.
---
 gdb/testsuite/gdb.base/catch-load.c   |    9 ++++++++-
 gdb/testsuite/gdb.base/catch-load.exp |    2 +-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.base/catch-load.c b/gdb/testsuite/gdb.base/catch-load.c
index 9a0010e..33c0a66 100644
--- a/gdb/testsuite/gdb.base/catch-load.c
+++ b/gdb/testsuite/gdb.base/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
+
 /* This is updated by the .exp file.  */
 char *libname = "catch-load-so.so";
 
diff --git a/gdb/testsuite/gdb.base/catch-load.exp b/gdb/testsuite/gdb.base/catch-load.exp
index 4bcaa44..28445b8 100644
--- a/gdb/testsuite/gdb.base/catch-load.exp
+++ b/gdb/testsuite/gdb.base/catch-load.exp
@@ -64,7 +64,7 @@ proc one_catch_load_test {scenario kind match sostop} {
 	gdb_test "catch $kind" "Catchpoint $decimal \\(.*\\)"
 
 	gdb_test_multiple "continue" "continue" {
-	    -re "Catchpoint $decimal\r\n.*loaded .*/$testfile2.*\r\n.*$gdb_prompt $" {
+	    -re "Catchpoint $decimal\r\n.*loaded .*(\\\\|/)$testfile2.*\r\n.*$gdb_prompt $" {
 		if {$match} {
 		    pass "continue"
 		} else {
-- 
1.7.7.6


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-09-17 18:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-12  1:00 [PATCH] Run catch-load.exp on Windows Yao Qi
2013-09-12  2:44 ` Eli Zaretskii
2013-09-12 11:38   ` Yao Qi
2013-09-12 15:36     ` Pierre Muller
2013-09-16 13:21       ` Yao Qi
2013-09-16 14:26         ` Pedro Alves
2013-09-16 16:24         ` Pierre Muller
     [not found]     ` <33630.1438547254$1379000229@news.gmane.org>
2013-09-17 18:39       ` Tom Tromey
2013-09-16 14:22 ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox