From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25207 invoked by alias); 22 Nov 2009 23:00:46 -0000 Received: (qmail 25193 invoked by uid 22791); 22 Nov 2009 23:00:42 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 22 Nov 2009 22:59:39 +0000 Received: (qmail 32417 invoked from network); 22 Nov 2009 22:59:36 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 22 Nov 2009 22:59:36 -0000 From: Pedro Alves To: =?iso-8859-1?q?S=E9rgio_Durigan_J=FAnior?= Subject: Make sure catch-syscall.exp doesn't pick up system/installed syscalls xml. Date: Sun, 22 Nov 2009 23:00:00 -0000 User-Agent: KMail/1.9.10 Cc: gdb-patches@sourceware.org, Joel Brobecker References: <200910022056.30734.pedro@codesourcery.com> <200910060144.08110.sergiodj@linux.vnet.ibm.com> <200910060948.04899.pedro@codesourcery.com> In-Reply-To: <200910060948.04899.pedro@codesourcery.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <200911222259.40063.pedro@codesourcery.com> X-IsSubscribed: yes 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 X-SW-Source: 2009-11/txt/msg00483.txt.bz2 On Tuesday 06 October 2009 09:48:04, Pedro Alves wrote: > On Tuesday 06 October 2009 05:44:08, S=E9rgio Durigan J=FAnior wrote: >=20 > > Also, there's one more thing I'd like to point out. The catch syscall= =20 > > testcase partially relies in the fact that GDB will not have the data- > > directory automatically set on startup.=20 >=20 > The tests run with "gdb -nx", thus garanteed to skip any > .gdbinit file. (I did check that the patch had introduced no > regressions.) >=20 > > This is because, among other things,=20=20 > > it has to test how GDB behaves when it doesn't have access to the XML f= iles=20 > > for the architecture (or even when those files don't exist at all), and= this=20 > > scenario is achieved when data-directory is empty. >=20 > But, data-directory isn't empty by default. >=20 > (gdb) show data-directory > GDB's data directory is "/usr/local/share/gdb". >=20 > > Anyway, if we decide to make this parameter be automatically set upon G= DB's=20 > > initialization in the build dir, we have to make sure that this doesn't= break=20 > > the testcase (I didn't test this specific case yet, but IIRC it's likel= y that=20 > > it will break). If it does, we may need to unset it on some situations= inside=20 > > the testcase in order to make it work properly. >=20 > Oh, the test is broken if the default system data-directory > _does_ have contents in it, from a previous installation. Easy to test. = See: >=20 > Using the default /usr/local/ prefix, no gdb installed yet: >=20 > $ make check RUNTESTFLAGS=3D"catch-syscall.exp" > ... > # of expected passes 45 >=20 > $ sudo make install > ... yadda, yadda ... >=20 > $ make check RUNTESTFLAGS=3D"catch-syscall.exp" >=20 > Running ../../../src/gdb/testsuite/gdb.base/catch-syscall.exp ... > FAIL: gdb.base/catch-syscall.exp: Catch syscall displays a warning when = there is no XML support > FAIL: gdb.base/catch-syscall.exp: catch syscall with arguments (3) > FAIL: gdb.base/catch-syscall.exp: syscall(s) 3 appears in 'info breakpoi= nts' > FAIL: gdb.base/catch-syscall.exp: program has called 3 > FAIL: gdb.base/catch-syscall.exp: syscall 3 has returned >=20 I've applied the patch below to fix this. --=20 Pedro Alves 2009-11-22 Pedro Alves * gdb.base/catch-syscall.exp (test_catch_syscall_fail_nodatadir) (do_syscall_tests_without_xml): Set data-directory to /the/path/to/nowhere. --- gdb/testsuite/gdb.base/catch-syscall.exp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) Index: src/gdb/testsuite/gdb.base/catch-syscall.exp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- src.orig/gdb/testsuite/gdb.base/catch-syscall.exp 2009-11-22 22:23:49.0= 00000000 +0000 +++ src/gdb/testsuite/gdb.base/catch-syscall.exp 2009-11-22 22:54:35.000000= 000 +0000 @@ -258,6 +258,10 @@ proc test_catch_syscall_fail_nodatadir { # Sanitizing. delete_breakpoints =20 + # Make sure GDB doesn't load the syscalls xml from the system data + # directory. + gdb_test "set data-directory /the/path/to/nowhere" "" + # Testing to see if we receive a warning when calling "catch syscall" # without XML support (without datadir). set thistest "Catch syscall displays a warning when there is no XML su= pport (no datadir set)" @@ -382,9 +386,9 @@ proc test_catch_syscall_with_wrong_args_ proc do_syscall_tests_without_xml {} { global gdb_prompt srcdir =20 - # In this case, we don't need to set GDB's datadir because - # we want GDB to display only numbers, not names. So, let's - # begin with the tests. + # Make sure GDB doesn't load the syscalls xml from the system data + # directory. + gdb_test "set data-directory /the/path/to/nowhere" "" =20 # Let's test if we can catch syscalls without XML support. # We should succeed, but GDB is not supposed to print syscall names.