From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29865 invoked by alias); 27 Mar 2012 15:05:47 -0000 Received: (qmail 29856 invoked by uid 22791); 27 Mar 2012 15:05:46 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 27 Mar 2012 15:05:33 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id ED02E1C6A3E; Tue, 27 Mar 2012 11:05:32 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id GpO2eukY171e; Tue, 27 Mar 2012 11:05:32 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 9B2A31C6A3C; Tue, 27 Mar 2012 11:05:32 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 63DF5145616; Tue, 27 Mar 2012 08:05:28 -0700 (PDT) Date: Tue, 27 Mar 2012 15:05:00 -0000 From: Joel Brobecker To: Keith Seitz Cc: "gdb-patches@sourceware.org ml" Subject: Re: [RFA 1/2] Linespec rewrite (update 2) Message-ID: <20120327150528.GE2701@adacore.com> References: <4F70F8F7.503@redhat.com> <20120327135623.GC2701@adacore.com> <4F71CEF5.8030805@redhat.com> <20120327145425.GD2701@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="dDRMvlgZJXvWKvBx" Content-Disposition: inline In-Reply-To: <20120327145425.GD2701@adacore.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2012-03/txt/msg00908.txt.bz2 --dDRMvlgZJXvWKvBx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 296 > I am almost done with the extension of operator_bp.exp; I'll send it > when I've removed all the typos and thinkos... Here it is... As expected, it fails on HEAD, so cannot commit just yet. But PASSes with your previous iteration of the patch series, and now fails... Thanks, Keith. -- Joel --dDRMvlgZJXvWKvBx Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-Add-more-tests-to-gdb.ada-operator_bp.exp.patch" Content-length: 6746 >From 88358dd0af5a781493eb5e98666f28b8bd486391 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Tue, 27 Mar 2012 07:37:31 -0700 Subject: [PATCH] Add more tests to gdb.ada/operator_bp.exp This patch adds testing of the FILE:OP:LINENO linespec (where OP is the name of an Ada operator) as well as testing of the FILE:OP linespec. gdb/testsuite/ChangeLog: * gdb.ada/operator_bp/ops.adb: Add source line markers. * gdb.ada/operator_bp.exp: Add testing of FILE:OP:LINENO as well as FILE:OP linespecs where OP is the name of an Ada operator. --- gdb/testsuite/gdb.ada/operator_bp.exp | 57 +++++++++++++++++++++++++++++ gdb/testsuite/gdb.ada/operator_bp/ops.adb | 36 +++++++++--------- 2 files changed, 75 insertions(+), 18 deletions(-) diff --git a/gdb/testsuite/gdb.ada/operator_bp.exp b/gdb/testsuite/gdb.ada/operator_bp.exp index 18cf46d..3c20f39 100644 --- a/gdb/testsuite/gdb.ada/operator_bp.exp +++ b/gdb/testsuite/gdb.ada/operator_bp.exp @@ -88,4 +88,61 @@ foreach op { "+" "-" "*" "/" "mod" "rem" "**" "<" "<=" ">" ">=" "=" "and" "or" " "continue to ops.\"$op\"" } +# Repeat the test, but qualify the operators with a filename and +# line number. + +clean_restart ${testfile} + +runto "ops_test.adb:$bp_location" + +foreach op { "+" "-" } { + set lineno [gdb_get_line_number "STOP \"$op\"" ${testdir}/ops.adb] + set op_re [string_to_regexp $op] + gdb_test "break ops.adb:\"$op\":$lineno" \ + "Breakpoint $decimal at $hex: ops\\.adb:\"$op_re\":$lineno\. \\(2 locations\\)" +} + +foreach op { "*" "/" "mod" "rem" "**" "<" "<=" ">" ">=" "=" "and" "or" "xor" "&" "abs" "not"} { + set lineno [gdb_get_line_number "STOP \"$op\"" ${testdir}/ops.adb] + set op_re [string_to_regexp $op] + gdb_test "break ops.adb:\"$op\":$lineno" \ + "Breakpoint $decimal at $hex: file .*ops.adb, line $decimal." +} + +# Make sure we stop correctly in each operator function. + +foreach op { "+" "-" "*" "/" "mod" "rem" "**" "<" "<=" ">" ">=" "=" "and" "or" "xor" "&" "abs" "not"} { + set op_re [string_to_regexp $op] + gdb_test "continue" \ + "Breakpoint $decimal, ops\\.\"$op_re\" .*"\ + "continue to ops.adb:\"$op\":LINE" +} + +# Repeat the test, but qualify the operators with a filename alone. + +clean_restart ${testfile} + +runto "ops_test.adb:$bp_location" + +foreach op { "+" "-" } { + set op_re [string_to_regexp $op] + gdb_test "break ops.adb:\"$op\"" \ + "Breakpoint $decimal at $hex: ops\\.adb:\"$op_re\". \\(2 locations\\)" +} + +foreach op { "*" "/" "mod" "rem" "**" "<" "<=" ">" ">=" "=" "and" "or" "xor" "&" "abs" "not"} { + set op_re [string_to_regexp $op] + gdb_test "break ops.adb:\"$op\"" \ + "Breakpoint $decimal at $hex: file .*ops.adb, line $decimal." +} + +# Make sure we stop correctly in each operator function. + +foreach op { "+" "-" "*" "/" "mod" "rem" "**" "<" "<=" ">" ">=" "=" "and" "or" "xor" "&" "abs" "not"} { + set op_re [string_to_regexp $op] + gdb_test "continue" \ + "Breakpoint $decimal, ops\\.\"$op_re\" .*"\ + "continue to ops.adb:\"$op\"" +} + diff --git a/gdb/testsuite/gdb.ada/operator_bp/ops.adb b/gdb/testsuite/gdb.ada/operator_bp/ops.adb index e7d94dc..fe9168c 100644 --- a/gdb/testsuite/gdb.ada/operator_bp/ops.adb +++ b/gdb/testsuite/gdb.ada/operator_bp/ops.adb @@ -22,38 +22,38 @@ package body Ops is function "+" (I1, I2 : Int) return Int is begin - return Int (IntRep (I1) + IntRep (I2)); + return Int (IntRep (I1) + IntRep (I2)); -- STOP "+" end; function "-" (I1, I2 : Int) return Int is begin - return Int (IntRep (I1) - IntRep (I2)); + return Int (IntRep (I1) - IntRep (I2)); -- STOP "-" end; function "*" (I1, I2 : Int) return Int is begin - return Int (IntRep (I1) * IntRep (I2)); + return Int (IntRep (I1) * IntRep (I2)); -- STOP "*" end; function "/" (I1, I2 : Int) return Int is begin - return Int (IntRep (I1) / IntRep (I2)); + return Int (IntRep (I1) / IntRep (I2)); -- STOP "/" end; function "mod" (I1, I2 : Int) return Int is begin - return Int (IntRep (I1) mod IntRep (I2)); + return Int (IntRep (I1) mod IntRep (I2)); -- STOP "mod" end; function "rem" (I1, I2 : Int) return Int is begin - return Int (IntRep (I1) rem IntRep (I2)); + return Int (IntRep (I1) rem IntRep (I2)); -- STOP "rem" end; function "**" (I1, I2 : Int) return Int is Result : IntRep := 1; begin - for J in 1 .. IntRep (I2) loop + for J in 1 .. IntRep (I2) loop -- STOP "**" Result := IntRep (I1) * Result; end loop; return Int (Result); @@ -61,57 +61,57 @@ package body Ops is function "<" (I1, I2 : Int) return Boolean is begin - return IntRep (I1) < IntRep (I2); + return IntRep (I1) < IntRep (I2); -- STOP "<" end; function "<=" (I1, I2 : Int) return Boolean is begin - return IntRep (I1) <= IntRep (I2); + return IntRep (I1) <= IntRep (I2); -- STOP "<=" end; function ">" (I1, I2 : Int) return Boolean is begin - return IntRep (I1) > IntRep (I2); + return IntRep (I1) > IntRep (I2); -- STOP ">" end; function ">=" (I1, I2 : Int) return Boolean is begin - return IntRep (I1) >= IntRep (I2); + return IntRep (I1) >= IntRep (I2); -- STOP ">=" end; function "=" (I1, I2 : Int) return Boolean is begin - return IntRep (I1) = IntRep (I2); + return IntRep (I1) = IntRep (I2); -- STOP "=" end; function "and" (I1, I2 : Int) return Int is begin - return Int (IntRep (I1) and IntRep (I2)); + return Int (IntRep (I1) and IntRep (I2)); -- STOP "and" end; function "or" (I1, I2 : Int) return Int is begin - return Int (IntRep (I1) or IntRep (I2)); + return Int (IntRep (I1) or IntRep (I2)); -- STOP "or" end; function "xor" (I1, I2 : Int) return Int is begin - return Int (IntRep (I1) xor IntRep (I2)); + return Int (IntRep (I1) xor IntRep (I2)); -- STOP "xor" end; function "&" (I1, I2 : Int) return Int is begin - return Int (IntRep (I1) and IntRep (I2)); + return Int (IntRep (I1) and IntRep (I2)); -- STOP "&" end; function "abs" (I1 : Int) return Int is begin - return Int (abs IntRep (I1)); + return Int (abs IntRep (I1)); -- STOP "abs" end; function "not" (I1 : Int) return Int is begin - return Int (not IntRep (I1)); + return Int (not IntRep (I1)); -- STOP "not" end; function "+" (I1 : Int) return Int is -- 1.7.1 --dDRMvlgZJXvWKvBx--