From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4154 invoked by alias); 22 Jun 2005 04:02:54 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 4083 invoked by uid 22791); 22 Jun 2005 04:02:40 -0000 Received: from ausmtp02.au.ibm.com (HELO ausmtp02.au.ibm.com) (202.81.18.187) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 22 Jun 2005 04:02:40 +0000 Received: from sd0208e0.au.ibm.com (d23rh904.au.ibm.com [202.81.18.202]) by ausmtp02.au.ibm.com (8.12.10/8.12.10) with ESMTP id j5M3vpHP162394 for ; Wed, 22 Jun 2005 13:57:53 +1000 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.250.244]) by sd0208e0.au.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j5M45BqS134678 for ; Wed, 22 Jun 2005 14:05:11 +1000 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.12.11/8.13.3) with ESMTP id j5M42HQL001557 for ; Wed, 22 Jun 2005 14:02:17 +1000 Received: from wks190384wss.cn.ibm.com (wks190384wss.cn.ibm.com [9.181.134.93]) by d23av03.au.ibm.com (8.12.11/8.12.11) with ESMTP id j5M42FIA001521 for ; Wed, 22 Jun 2005 14:02:16 +1000 Date: Wed, 22 Jun 2005 04:02:00 -0000 From: Wu Zhou To: gdb-patches@sources.redhat.com Subject: [RFA] New testcase to evaluate Fortran substring expression Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2005-06/txt/msg00346.txt.bz2 Sorry, I miss-typed the mail address. Original text is as follows: ---------- Forwarded message ---------- Date: Wed, 22 Jun 2005 10:39:48 +0800 (CST) From: Wu Zhou To: gdb-patches@cn.ibm.com Cc: eliz@gnu.org, drow@false.org Subject: [RFA] New testcase to evaluate Fortran substring expression Eli/Daniel and all, Here is my new testcase to evaluate Fortran substring expression. The intention is to test whehter current GDB could correctly handle substring expression evaluation of Fortran. I tested it against g77-3.2.3 and gfortran-4.0.0. The last four tests failed for both configuration. I am also thinking of fixing these errors. It is easy to fix str(exp:exp) and str(:), but I am not sure how to fix str(:exp) and str(exp:) yet. Any hints/tips on this? TIA. 2005-06-22 Wu Zhou * gdb.fortran/substring.f: New file. * gdb.fortran/substring.exp: New testcase. *** /dev/null 2005-06-19 07:34:09.109204120 +0800 --- gdb.fortran/substring.f 2005-06-21 02:28:32.000000000 +0800 *************** *** 0 **** --- 1,31 ---- + c Copyright 2005 Free Software Foundation, Inc. + + c This program is free software; you can redistribute it and/or modify + c it under the terms of the GNU General Public License as published by + c the Free Software Foundation; either version 2 of the License, or + c (at your option) any later version. + c + c This program is distributed in the hope that it will be useful, + c but WITHOUT ANY WARRANTY; without even the implied warranty of + c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + c GNU General Public License for more details. + c + c You should have received a copy of the GNU General Public License + c along with this program; if not, write to the Free Software + c Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + c Ihis file is the Fortran source file for substring.exp. It was written + c by Wu Zhou. (woodzltc@cn.ibm.com) + + PROGRAM substring + + character *26 str + + str = 'abcdefghijklmnopqrstuvwxyz' + + write (*, *) str(1:7) + write (*, *) str(:7) + write (*, *) str(20:) + write (*, *) str(:) + + END PROGRAM *** /dev/null 2005-06-19 07:34:09.109204120 +0800 --- gdb.fortran/substring.exp 2005-06-22 10:32:41.000000000 +0800 *************** *** 0 **** --- 1,60 ---- + # Copyright 2005 Free Software Foundation, Inc. + + # This program is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2 of the License, or + # (at your option) any later version. + # + # This program is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + # GNU General Public License for more details. + # + # You should have received a copy of the GNU General Public License + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + # This file was written by Wu Zhou. (woodzltc@cn.ibm.com) + + # This file is part of the gdb testsuite. It contains tests for evaluating + # Fortran substring expression + + if $tracelevel then { + strace $tracelevel + } + + set testfile "substring" + set srcfile ${testfile}.f + set binfile ${objdir}/${subdir}/${testfile} + + if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f77 quiet}] != "" } { + untested "Couldn't compile ${srcfile}" + return -1 + } + + gdb_exit + gdb_start + gdb_reinitialize_dir $srcdir/$subdir + gdb_load ${binfile} + + if ![runto MAIN__] then { + perror "couldn't run to breakpoint sub_" + continue + } + + # Try to set breakpoint at the last write statement. + + set bp_location [gdb_get_line_number "str(:)"] + gdb_test "break $bp_location" \ + "Breakpoint.*at.* file .*$srcfile, line $bp_location\\." \ + "breakpoint at the last write statement" + gdb_test "continue" \ + "Continuing\\..*Breakpoint.*" \ + "continue to breakpoint" + + # Test four different kinds of substring expression evaluation. + + gdb_test "print str(1:7)" ".*1 = .*" "print str(1:7)" + gdb_test "print str(:7)" ".*2 = .*" "print str(:7)" + gdb_test "print str(20:)" ".*3 = .*" "print str(20:)" + gdb_test "print str(:)" ".*4 = .*" "print str(:)" Cheers - Wu Zhou