From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27807 invoked by alias); 16 Sep 2013 14:22:33 -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 27795 invoked by uid 89); 16 Sep 2013 14:22:33 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 16 Sep 2013 14:22:33 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.8 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r8GEMSOO006942 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 16 Sep 2013 10:22:28 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r8GEMQpx014339; Mon, 16 Sep 2013 10:22:27 -0400 Message-ID: <52371422.6020806@redhat.com> Date: Mon, 16 Sep 2013 14:22:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Yao Qi CC: gdb-patches@sourceware.org Subject: Re: [PATCH] Run catch-load.exp on Windows References: <1378947563-26245-1-git-send-email-yao@codesourcery.com> In-Reply-To: <1378947563-26245-1-git-send-email-yao@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2013-09/txt/msg00448.txt.bz2 On 09/12/2013 01:59 AM, Yao Qi wrote: > 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. Looks fine to me. It's how we do things in other similar cases. > 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. (I think we could just as well just remove the '/', which looks to be how gdb.base/info-shared.exp handles things, and probably what makes it work on Windows without caring for this detail). > 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 { > -- Pedro Alves