From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23798 invoked by alias); 12 Sep 2013 01:00:22 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 23786 invoked by uid 89); 12 Sep 2013 01:00:21 -0000 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Sep 2013 01:00:21 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RDNS_NONE,SPF_HELO_FAIL autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1VJvGa-0003yS-HA from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Wed, 11 Sep 2013 18:00:16 -0700 Received: from SVR-ORW-FEM-02.mgc.mentorg.com ([147.34.96.206]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 11 Sep 2013 18:00:15 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.2.247.3; Wed, 11 Sep 2013 18:00:14 -0700 From: Yao Qi To: Subject: [PATCH] Run catch-load.exp on Windows Date: Thu, 12 Sep 2013 01:00:00 -0000 Message-ID: <1378947563-26245-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2013-09/txt/msg00364.txt.bz2 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 * 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 . */ -#include #include +#ifdef __WIN32__ +#include +#define dlopen(name, mode) LoadLibrary (TEXT (name)) +#define dlclose(handle) FreeLibrary (handle) +#else +#include +#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