From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id 96EE638518BE; Thu, 24 Nov 2022 15:23:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 96EE638518BE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669303435; bh=+2u8MtoeI3YNtHXnIMFiF1H179sRxpCt+tDJven/oQg=; h=From:To:Subject:Date:From; b=khKN60/1o2mcyFx9dvIbCFOLpnLcyKyvFGC2Ii/9PVWRu/zns9p/jjrrXU/MHOv5i 1kM3rKiwQYJPFzvlVgMTia7c+2veNurU0dxsT1wiia4Y4sA4CdBtLoaMPJwGZ0VSqG FbQmT69Y5BbsCzdvvUvhhoM/44jXI/J6zv8tcNTI= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Simon Marchi To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb/testsuite/gdb.base/break.exp: split test_tbreak X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: 46c3b224a35e16197225fe76e7b5546830d2501a X-Git-Newrev: 3274ac5378664deb7d74866028ef5c2a122ad4fe Message-Id: <20221124152355.96EE638518BE@sourceware.org> Date: Thu, 24 Nov 2022 15:23:55 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D3274ac537866= 4deb7d74866028ef5c2a122ad4fe commit 3274ac5378664deb7d74866028ef5c2a122ad4fe Author: Simon Marchi Date: Wed Nov 23 13:39:58 2022 -0500 gdb/testsuite/gdb.base/break.exp: split test_tbreak =20 Leave setting bp_location11 in the global scope, so that it's accessible to other procs. =20 Change-Id: I8928f01640d3a1e993649b2168b9eda0724ee1d9 Approved-By: Kevin Buettner Diff: --- gdb/testsuite/gdb.base/break.exp | 82 ++++++++++++++++++------------------= ---- 1 file changed, 36 insertions(+), 46 deletions(-) diff --git a/gdb/testsuite/gdb.base/break.exp b/gdb/testsuite/gdb.base/brea= k.exp index 4a2f130ff29..1aa9476c0cf 100644 --- a/gdb/testsuite/gdb.base/break.exp +++ b/gdb/testsuite/gdb.base/break.exp @@ -423,55 +423,45 @@ gdb_test "continue" \ ".*Breakpoint \[0-9\]+, main \\(argc=3D.*, argv=3D.*, envp=3D.*\\) at = .*$srcfile:$bp_location10a.*$bp_location10a\[\t \]+}.*breakpoint 10a here.*= " \ "continue to breakpoint at }" =20 -# -# delete all breakpoints so we can start over, course this can be a test t= oo -# -delete_breakpoints - -# -# test temporary breakpoint at function -# - -gdb_test "tbreak -q main" "Temporary breakpoint.*at.* file .*$srcfile, lin= e.*" "temporary breakpoint function" - -# -# test break at function in file -# - -gdb_test "tbreak $srcfile:factorial" "Temporary breakpoint.*at.* file .*$s= rcfile, line.*" \ - "Temporary breakpoint function in file" - -# -# test break at line number -# -gdb_test "tbreak $bp_location1" \ - "Temporary breakpoint.*at.* file .*$srcfile, line $bp_location1.*" \ - "temporary breakpoint line number #1" - -gdb_test "tbreak $bp_location6" "Temporary breakpoint.*at.* file .*$srcfil= e, line $bp_location6.*" "temporary breakpoint line number #2" - -# -# test break at line number in file -# -gdb_test "tbreak $srcfile:$bp_location2" \ - "Temporary breakpoint.*at.* file .*$srcfile, line $bp_location2.*" \ - "temporary breakpoint line number in file #1" - set bp_location11 [gdb_get_line_number "set breakpoint 11 here"] -gdb_test "tbreak $srcfile:$bp_location11" "Temporary breakpoint.*at.* fil= e .*$srcfile, line $bp_location11.*" "Temporary breakpoint line number in f= ile #2" =20 -# -# check to see what breakpoints are set (temporary this time) -# -gdb_test "info break" "Num Type.*Disp Enb Address.*What.*\[\r\n\] -\[0-9\]+\[\t \]+breakpoint del.*y.*in [func main] at .*$srcfile:$main_= line.*\[\r\n\] -\[0-9\]+\[\t \]+breakpoint del.*y.*in [func factorial] at .*$srcfile:$= bp_location7.*\[\r\n\] -\[0-9\]+\[\t \]+breakpoint del.*y.*in [func main] at .*$srcfile:$bp_lo= cation1.*\[\r\n\] -\[0-9\]+\[\t \]+breakpoint del.*y.*in [func main] at .*$srcfile:$bp_lo= cation6.*\[\r\n\] -\[0-9\]+\[\t \]+breakpoint del.*y.*in [func main] at .*$srcfile:$bp_lo= cation2.*\[\r\n\] -\[0-9\]+\[\t \]+breakpoint del.*y.*in [func main] at .*$srcfile:$bp_lo= cation11.*" \ - "Temporary breakpoint info" +proc_with_prefix test_tbreak {} { + clean_restart break + + # test temporary breakpoint at function + gdb_test "tbreak -q main" "Temporary breakpoint.*at.* file .*$::srcfil= e, line.*" "temporary breakpoint function" + + # test break at function in file + gdb_test "tbreak $::srcfile:factorial" "Temporary breakpoint.*at.* fil= e .*$::srcfile, line.*" \ + "Temporary breakpoint function in file" + + # test break at line number + gdb_test "tbreak $::bp_location1" \ + "Temporary breakpoint.*at.* file .*$::srcfile, line $::bp_location1.*" \ + "temporary breakpoint line number #1" + + gdb_test "tbreak $::bp_location6" "Temporary breakpoint.*at.* file .*$= ::srcfile, line $::bp_location6.*" "temporary breakpoint line number #2" + + # test break at line number in file + gdb_test "tbreak $::srcfile:$::bp_location2" \ + "Temporary breakpoint.*at.* file .*$::srcfile, line $::bp_location2.*" \ + "temporary breakpoint line number in file #1" + + gdb_test "tbreak $::srcfile:$::bp_location11" "Temporary breakpoint.*= at.* file .*$::srcfile, line $::bp_location11.*" "Temporary breakpoint line= number in file #2" + + # check to see what breakpoints are set (temporary this time) + gdb_test "info break" \ + [multi_line "Num Type.*Disp Enb Address.*What.*" \ + "$::decimal\[\t \]+breakpoint del.*y.*in [func main] at .*$::src= file:$::main_line.*" \ + "$::decimal\[\t \]+breakpoint del.*y.*in [func factorial] at .*$= ::srcfile:$::bp_location7.*" \ + "$::decimal\[\t \]+breakpoint del.*y.*in [func main] at .*$::src= file:$::bp_location1.*" \ + "$::decimal\[\t \]+breakpoint del.*y.*in [func main] at .*$::src= file:$::bp_location6.*" \ + "$::decimal\[\t \]+breakpoint del.*y.*in [func main] at .*$::src= file:$::bp_location2.*" \ + "$::decimal\[\t \]+breakpoint del.*y.*in [func main] at .*$::src= file:$::bp_location11.*"] \ + "Temporary breakpoint info" +} =20 +test_tbreak =20 #***********