From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9287 invoked by alias); 6 Jan 2009 14:05:38 -0000 Received: (qmail 9277 invoked by uid 22791); 6 Jan 2009 14:05:36 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,KAM_MX,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 06 Jan 2009 14:05:31 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n06E5PqR009612; Tue, 6 Jan 2009 09:05:25 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n06E5PQv001326; Tue, 6 Jan 2009 09:05:25 -0500 Received: from host0.dyn.jankratochvil.net (sebastian-int.corp.redhat.com [172.16.52.221]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n06E5Nr2012612; Tue, 6 Jan 2009 09:05:24 -0500 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.3) with ESMTP id n06E5HSu020877; Tue, 6 Jan 2009 15:05:20 +0100 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.2/Submit) id n06E5GgJ020873; Tue, 6 Jan 2009 15:05:16 +0100 Date: Tue, 06 Jan 2009 14:05:00 -0000 From: Jan Kratochvil To: Joel Brobecker Cc: gdb-patches@sourceware.org, Markus Deuling Subject: Re: [patch] Testsuite: Fortran: 6.8 regression + gfortran updates Message-ID: <20090106140516.GA16916@host0.dyn.jankratochvil.net> References: <20081208181523.GA23831@host0.dyn.jankratochvil.net> <20081229034845.GF4216@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20081229034845.GF4216@adacore.com> User-Agent: Mutt/1.5.18 (2008-05-17) 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-01/txt/msg00047.txt.bz2 On Mon, 29 Dec 2008 04:48:45 +0100, Joel Brobecker wrote: > > - "type = Type bar.*int4.*\:\: c.*real.*\:\: d.*End Type bar" \ > > + "type = Type bar.*int.*\:\: c.*real.*\:\: d.*End Type bar" \ > ^^^^^^ > > What does the debugger print in your case? int8 or integer, or...? I did not know before (as the former pattern had too many wildcards). Found out now gfortran-4.1 had the types really named like `int4'. The excessive spacing from f-typeprint.c is a regression by: http://sourceware.org/ml/gdb-patches/2008-04/msg00383.html http://sourceware.org/ml/gdb-cvs/2008-04/msg00135.html http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/f-typeprint.c.diff?cvsroot=src&r1=1.22&r2=1.23 This patch fixes it back: (gdb) ptype q type = Type foo real(kind=4) :: a Type bar integer(kind=4) :: c real(kind=4) :: d -> (gdb) ptype q type = Type foo real(kind=4) :: a Type bar integer(kind=4) :: c real(kind=4) :: d > > -gdb_test "print q%b" "\\$\[0-9\]+ = \\(.*a.*b.*c.*d.*e.*f.*g.*\\)" > > +gdb_test "print q%b" "\\$\[0-9\]+ = (\\(.*a.*b.*c.*d.*e.*f.*g.*\\)|'abcdefg')" > > Under what circumstances will the debugger print the string as an array > of characters as opposed to a string? Fedora gcc-gfortran-4.1.2-33.x86_64. Did not test upstream gfortran-4.1. No regressions on gcc-4.3.2-7.x86_64 and no regressions for gdb.fortran/ on gcc-4.1.2-33.x86_64. OK to commit? Thanks, Jan gdb/ 2009-01-06 Jan Kratochvil * f-typeprint.c (f_type_print_base ): Fix output spacing, a regression from 2008-04-22. gdb/testsuite/ 2009-01-06 Jan Kratochvil * gdb.fortran/derived-type.exp: New variables int4 and real4. Match now the output exactly, using less wildcards. Expect also the output of gfortran-4.3. Update for the f-valprint.c modification from 2008-04-22. --- gdb/f-typeprint.c 3 Jan 2009 05:57:51 -0000 1.25 +++ gdb/f-typeprint.c 6 Jan 2009 13:09:12 -0000 @@ -359,8 +359,7 @@ f_type_print_base (struct type *type, st f_type_print_base (TYPE_FIELD_TYPE (type, index), stream, show, level + 4); fputs_filtered (" :: ", stream); - fprintfi_filtered (level, stream, "%s", - TYPE_FIELD_NAME (type, index)); + fputs_filtered (TYPE_FIELD_NAME (type, index), stream); f_type_print_varspec_suffix (TYPE_FIELD_TYPE (type, index), stream, 0, 0, 0); fputs_filtered ("\n", stream); --- gdb/testsuite/gdb.fortran/derived-type.exp 3 Jan 2009 05:58:04 -0000 1.7 +++ gdb/testsuite/gdb.fortran/derived-type.exp 6 Jan 2009 13:09:14 -0000 @@ -41,24 +41,54 @@ if ![runto MAIN__] then { continue } -gdb_test "ptype p" \ - "type = Type bar.*int4.*\:\: c.*real.*\:\: d.*End Type bar" \ - "ptype p" -gdb_test "ptype q" \ - "type = Type foo.*real.*\:\: a.*Type bar.*int4.*\:\: c.*real.*\:\: d.*End Type bar \:\: x.*character.*\\(7\\) \:\: b.*End Type foo" \ - "type-printing for derived type" +set int4 "(int4|integer\\(kind=4\\))" +set real4 "(real4|real\\(kind=4\\))" + +gdb_test "ptype p" "type = Type bar\r\n *${int4} :: c\r\n *${real4} :: d\r\n *End Type bar" + +set test "type-printing for derived type" +gdb_test_multiple "ptype q" $test { + -re "type = Type foo\r\n *${real4} :: a\r\n *Type bar\r\n *${int4} :: c\r\n *${real4} :: d\r\n *End Type bar :: x\r\n *character\\*7 :: b\r\n *End Type foo\r\n$gdb_prompt $" { + pass $test + } + -re "type = Type foo\r\n *${real4} :: a\r\n *Type bar\r\n *${int4} :: c\r\n *${real4} :: d\r\n *End Type bar :: x\r\n *character :: b\\(7\\)\r\n *End Type foo\r\n$gdb_prompt $" { + # Compiler should produce string, not an array of characters. + setup_xfail "*-*-*" + fail $test + } +} gdb_breakpoint [gdb_get_line_number "print"] gdb_continue_to_breakpoint "print" -gdb_test "print p" "\\$\[0-9\]+ = \\{ 1, 2.375\\}" +gdb_test "print p" "\\$\[0-9\]+ = \\( 1, 2\\.375 \\)" gdb_test "print p%c" "\\$\[0-9\]+ = 1" -gdb_test "print p%d" "\\$\[0-9\]+ = 2.375" -gdb_test "print q%a" "\\$\[0-9\]+ = 3.125" -gdb_test "print q%b" "\\$\[0-9\]+ = \\(.*a.*b.*c.*d.*e.*f.*g.*\\)" +gdb_test "print p%d" "\\$\[0-9\]+ = 2\\.375" +gdb_test "print q%a" "\\$\[0-9\]+ = 3\\.125" + +set test "print q%b" +gdb_test_multiple $test $test { + -re "\\$\[0-9\]+ = 'abcdefg'\r\n$gdb_prompt $" { + pass $test + } + -re "\\$\[0-9\]+ = \\(97 'a', 98 'b', 99 'c', 100 'd', 101 'e', 102 'f', 103 'g'\\)\r\n$gdb_prompt $" { + # Compiler should produce string, not an array of characters. + setup_xfail "*-*-*" + fail $test + } +} + gdb_test "print q%x%c" "\\$\[0-9\]+ = 1" -gdb_test "print q%x%d" "\\$\[0-9\]+ = 2.375" -gdb_test "print q" \ - "\\$\[0-9\]+ = \\{ 3.125, \\{ 1, 2.375\\}, \\(.*a.*b.*c.*d.*e.*f.*g.*\\)\\}" \ - "print q" +gdb_test "print q%x%d" "\\$\[0-9\]+ = 2\\.375" +set test "print q" +gdb_test_multiple $test $test { + -re "\\$\[0-9\]+ = \\( 3.125, \\( 1, 2\\.375 \\), 'abcdefg' \\)\r\n$gdb_prompt $" { + pass $test + } + -re "\\$\[0-9\]+ = \\( 3.125, \\( 1, 2\\.375 \\), \\(97 'a', 98 'b', 99 'c', 100 'd', 101 'e', 102 'f', 103 'g'\\) \\)\r\n$gdb_prompt $" { + # Compiler should produce string, not an array of characters. + setup_xfail "*-*-*" + fail $test + } +} --- gdb/testsuite/gdb.fortran/subarray.exp 3 Jan 2009 05:58:04 -0000 1.7 +++ gdb/testsuite/gdb.fortran/subarray.exp 6 Jan 2009 13:09:14 -0000 @@ -53,13 +53,56 @@ gdb_test "continue" \ # Test four different kinds of subarray expression evaluation. -gdb_test "print str(2:4)" ".*1 = \\(98 'b', 99 'c', 100 'd'\\).*" "print str(2:4)" -gdb_test "print str(:3)" ".*2 = \\(97 'a', 98 'b', 99 'c'\\).*" "print str(:3)" -gdb_test "print str(5:)" ".*3 = \\(101 'e', 102 'f', 103 'g'\\).*" "print str(5:)" -gdb_test "print str(:)" ".*4 = \\(97 'a', 98 'b', 99 'c', 100 'd', 101 'e', 102 'f', 103 'g'\\).*" "print str(:)" +set test "print str(2:4)" +gdb_test_multiple $test $test { + -re "\\$\[0-9\]+ = 'bcd'\r\n$gdb_prompt $" { + pass $test + } + -re "\\$\[0-9\]+ = \\(98 'b', 99 'c', 100 'd'\\)\r\n$gdb_prompt $" { + # Compiler should produce string, not an array of characters. + setup_xfail "*-*-*" + fail $test + } +} -gdb_test "print array(2:4)" ".*5 = \\(2, 3, 4\\).*" "print array(2:4)" -gdb_test "print array(:3)" ".*6 = \\(1, 2, 3\\).*" "print array(:3)" -gdb_test "print array(5:)" ".*7 = \\(5, 6, 7\\).*" "print array(5:)" -gdb_test "print array(:)" ".*8 = \\(1, 2, 3, 4, 5, 6, 7\\).*" "print array(:)" +set test "print str(:3)" +gdb_test_multiple $test $test { + -re "\\$\[0-9\]+ = 'abc'\r\n$gdb_prompt $" { + pass $test + } + -re "\\$\[0-9\]+ = \\(97 'a', 98 'b', 99 'c'\\)\r\n$gdb_prompt $" { + # Compiler should produce string, not an array of characters. + setup_xfail "*-*-*" + fail $test + } +} + +set test "print str(5:)" +gdb_test_multiple $test $test { + -re "\\$\[0-9\]+ = 'efg'\r\n$gdb_prompt $" { + pass $test + } + -re "\\$\[0-9\]+ = \\(101 'e', 102 'f', 103 'g'\\)\r\n$gdb_prompt $" { + # Compiler should produce string, not an array of characters. + setup_xfail "*-*-*" + fail $test + } +} + +set test "print str(:)" +gdb_test_multiple $test $test { + -re "\\$\[0-9\]+ = 'abcdefg'\r\n$gdb_prompt $" { + pass $test + } + -re "\\$\[0-9\]+ = \\(97 'a', 98 'b', 99 'c', 100 'd', 101 'e', 102 'f', 103 'g'\\)\r\n$gdb_prompt $" { + # Compiler should produce string, not an array of characters. + setup_xfail "*-*-*" + fail $test + } +} + +gdb_test "print array(2:4)" "\\$\[0-9\]+ = \\(2, 3, 4\\)" +gdb_test "print array(:3)" "\\$\[0-9\]+ = \\(1, 2, 3\\)" +gdb_test "print array(5:)" "\\$\[0-9\]+ = \\(5, 6, 7\\)" +gdb_test "print array(:)" "\\$\[0-9\]+ = \\(1, 2, 3, 4, 5, 6, 7\\)"