From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28837 invoked by alias); 25 Jun 2008 06:15:37 -0000 Received: (qmail 28822 invoked by uid 22791); 25 Jun 2008 06:15:35 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate1.de.ibm.com (HELO mtagate1.de.ibm.com) (195.212.29.150) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 25 Jun 2008 06:15:14 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate1.de.ibm.com (8.13.8/8.13.8) with ESMTP id m5P6F0oi134580 for ; Wed, 25 Jun 2008 06:15:00 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.0) with ESMTP id m5P6F04Z4112482 for ; Wed, 25 Jun 2008 08:15:00 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m5P6ExPV011040 for ; Wed, 25 Jun 2008 08:15:00 +0200 Received: from bbkeks.de.ibm.com (dyn-9-152-248-45.boeblingen.de.ibm.com [9.152.248.45]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id m5P6EwCI011014 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 25 Jun 2008 08:14:59 +0200 Message-ID: <4861E262.909@de.ibm.com> Date: Wed, 25 Jun 2008 12:43:00 -0000 From: Markus Deuling User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Ulrich Weigand CC: GDB Patches Subject: Re: [patch]: Improve spu-info testcase References: <200806241915.m5OJFML0013250@d12av02.megacenter.de.ibm.com> In-Reply-To: <200806241915.m5OJFML0013250@d12av02.megacenter.de.ibm.com> Content-Type: multipart/mixed; boundary="------------000702090908060206080704" 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: 2008-06/txt/msg00423.txt.bz2 This is a multi-part message in MIME format. --------------000702090908060206080704 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 959 Ulrich Weigand schrieb: > Can we change the test to either use a pre-existing file (/dev/zero ?), or else > move allocating/deleting the file to the DejaGnu script instead and pass the > file name to the test case? That way we can probably more easily adapt to > local vs. cross debugging, and make sure the file is deleted in every case > (even if debugging crashes). The testcase now defines (and deletes after usage) a temporary file which is given to the SPU binary as command line argument. If the SPU binary doesn't receive a command line argument it falls back to the default file in /var/tmp. Ok ? ChangeLog: * gdb.arch/spu-info.exp (tmp_file): Introduce temporary file and set it as command line argument for test binary. Delete after usage. * gdb.arch/spu-info.c (main): Receive command line arguments. (do_dma_test): Add file paramater. Regards, Markus -- Markus Deuling GNU Toolchain for Linux on Cell BE deuling@de.ibm.com --------------000702090908060206080704 Content-Type: text/plain; name="diff-spu-info" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="diff-spu-info" Content-length: 3590 diff -urpN src/gdb/testsuite/gdb.arch/spu-info.c dev/gdb/testsuite/gdb.arch/spu-info.c --- src/gdb/testsuite/gdb.arch/spu-info.c 2008-01-01 23:53:18.000000000 +0100 +++ dev/gdb/testsuite/gdb.arch/spu-info.c 2008-06-25 08:01:40.000000000 +0200 @@ -124,14 +124,13 @@ do_event_test () } int -do_dma_test () +do_dma_test (char *file) { #define MAP_FAILED (-1ULL) #define PROT_READ 0x1 #define MAP_PRIVATE 0x002 #define BSIZE 128 static char buf[BSIZE] __attribute__ ((aligned (128))); - char *file = "/var/tmp/tmp_buf"; struct stat fdstat; int fd, cnt; unsigned long long src; @@ -211,9 +210,7 @@ do_signal_test () return 0; } -int -main (unsigned long long speid, unsigned long long argp, - unsigned long long envp) +int main (int argc, char **argv) { int res; @@ -221,7 +218,10 @@ main (unsigned long long speid, unsigned res = do_event_test (); /* info spu dma */ - res = do_dma_test (); + if (argc == 2) + res = do_dma_test (argv[1]); + else + res = do_dma_test ("/var/tmp/tmp_buf"); /* info spu mailbox */ res = do_mailbox_test (); diff -urpN src/gdb/testsuite/gdb.arch/spu-info.exp dev/gdb/testsuite/gdb.arch/spu-info.exp --- src/gdb/testsuite/gdb.arch/spu-info.exp 2008-03-31 10:34:42.000000000 +0200 +++ dev/gdb/testsuite/gdb.arch/spu-info.exp 2008-06-25 08:07:51.000000000 +0200 @@ -31,7 +31,7 @@ set srcfile ${testfile}.c set binfile ${objdir}/${subdir}/${testfile} set sources ${srcdir}/${subdir}/${srcfile} -if { [gdb_compile $sources ${binfile} executable { debug }] != "" } { +if { [gdb_compile $sources ${binfile} executable { debug additional_flags=-mstdmain }] != "" } { return -1 } @@ -40,6 +40,13 @@ gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} +set tmp_file "" +if { [info exists env(PWD)] && + [info exists env(USER)] } then { + set tmp_file $env(PWD)/gdb_spu_info_$env(USER) + gdb_test "set args $tmp_file" "" "" +} + # Continue to MARKER proc c_to { marker } { global srcfile @@ -52,8 +59,6 @@ proc c_to { marker } { "continue to $line" } - - if ![runto_main] then { fail "Can't run to main" return 0 @@ -186,14 +191,14 @@ gdb_test "info spu event" \ # 'info spu dma' should be empty. c_to "Marker DMA" gdb_test "info spu dma" \ - "Tag-Group Status.*0x00000000.*Tag-Group Mask.*0x00000000.*Stall-and-Notify.*0x00000000.*Atomic Cmd Status.*0x00000000.*Opcode.*Tag.*TId.*RId.*EA.*LSA.*Size.*LstAddr.*LstSize.*E.*0.*0.*0.*0.*0x00000 0x00000.*" \ + "Tag-Group Status.*0x00000001.*Tag-Group Mask.*0x00000001.*Stall-and-Notify.*0x00000000.*Atomic Cmd Status.*0x00000000.*Opcode.*Tag.*TId.*RId.*EA.*LSA.*Size.*LstAddr.*LstSize.*E.*0.*0.*0.*0.*0x00000 0x00000.*" \ "info spu dma (empty)" # 'info spu dma' should be filled with some data. c_to "Marker DMAWait" gdb_test "next" "" "next" gdb_test "info spu dma" \ - "Tag-Group Status.*0x00000000.*Tag-Group Mask.*0x00000020.*Stall-and-Notify.*0x00000000.*Atomic Cmd Status.*0x00000000.*Opcode.*Tag.*TId.*RId.*EA.*LSA.*Size.*LstAddr.*LstSize.*E.*getl.*putllc.*get.*mfcsync.*get.*0.*0.*0.*0.*0x00000 0x00000.*" \ + "Tag-Group Status.*0x00000001.*Tag-Group Mask.*0x00000020.*Stall-and-Notify.*0x00000000.*Atomic Cmd Status.*0x00000000.*Opcode.*Tag.*TId.*RId.*EA.*LSA.*Size.*LstAddr.*LstSize.*E.*getl.*putllc.*get.*mfcsync.*get.*0.*0.*0.*0.*0x00000 0x00000.*" \ "info spu dma (non-empty)" gdb_test "finish" "" "finish" @@ -245,5 +250,7 @@ gdb_test "info spu signal" \ gdb_exit - +if { [file exists $tmp_file] } then { + file delete $tmp_file +} return 0 --------------000702090908060206080704--