From patchwork Wed Apr 16 18:53:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Seitz X-Patchwork-Id: 582 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx20.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id 46D1B36007A for ; Wed, 16 Apr 2014 11:53:22 -0700 (PDT) Received: by homiemail-mx20.g.dreamhost.com (Postfix, from userid 14314964) id 0D31D411533B8; Wed, 16 Apr 2014 11:53:21 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx20.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx20.g.dreamhost.com (Postfix) with ESMTPS id CA1FF41115B7B for ; Wed, 16 Apr 2014 11:53:21 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :content-type; q=dns; s=default; b=ZfbvlEqbJc5/fxRFA18youPw89NRR uX0PcuTxQGCDsgp8yr15fpLNTlVa6Xclt25AAfa5j7r0WvCHvDZvm86eVZJ+QLqi LfjlR1fCYVK6YxaqTDETjIzOdkhh7oUO3myL1H5whyOiEubn+sIgJIsFhY6G+cGu N3GUcKy6pgJ+30= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:subject :content-type; s=default; bh=lu8aQBMr3qg8KFPYhBeZSPSIx6c=; b=yRY m9yvGxy7YQ9U/sXglaGiZP8ET3Gx2ndqNxEigQbvwa945nRrE8dizG9rvC3MUju/ h+cH7JHMZrbfC2v/qQ2PlE1L+W/am2blA7oAD+ihyks8MN4xvzOZGrrVhrBnW3+v pGjbadoOMW3WGO2JjgVuL9UwgHXPivdKvjYjsxRI= Received: (qmail 2149 invoked by alias); 16 Apr 2014 18:53:19 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 2133 invoked by uid 89); 16 Apr 2014 18:53:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 16 Apr 2014 18:53:16 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s3GIrEuA032489 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 16 Apr 2014 14:53:14 -0400 Received: from valrhona.uglyboxes.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s3GIrDPn003933 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Wed, 16 Apr 2014 14:53:13 -0400 Message-ID: <534ED199.3050004@redhat.com> Date: Wed, 16 Apr 2014 11:53:13 -0700 From: Keith Seitz User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: "gdb-patches@sourceware.org ml" Subject: [RFA testsuite 5/5] Update all callers X-IsSubscribed: yes X-DH-Original-To: gdb@patchwork.siddhesh.in Hi, This patch is largely mechanical. It does two things. First it updates all callers of mi_create_breakpoint to the new API. Second, it updates uses of -break-info/mi_list_breakpoints to use make_breakpoint_table. [Side effect: several globals were no longer necessary, so I've also removed them.] Keith testsuite/ChangeLog 2014-04-15 Keith Seitz * gdb.mi/mi-break.exp: Remove unused globals, update mi_create_breakpoint usage, and use mi_make_breakpoint_table. All callers updated. * gdb.mi/mi-dprintf.exp: Use variable to track command number. Update all callers of mi_create_breakpoint and use mi_make_breakpoint_table. Remove any unused global variables. * gdb.mi/mi-nonstop.exp: Likewise. * gdb.mi/mi-nsintrall.exp: Likewise. * gdb.mi/mi-nsmoribund.exp: Likewise. * gdb.mi/mi-nsthrexec.exp: Likewise. * gdb.mi/mi-reverse.exp: Likewise. * gdb.mi/mi-simplerun.exp: Likewise. * gdb.mi/mi-stepn.exp: Likewise. * gdb.mi/mi-syn-frame.exp: Likewise. * gdb.mi/mi-until.exp: Likewise. * gdb.mi/mi-var-cp.exp: Likewise. * gdb.mi/mi-var-display.exp: Likewise. * gdb.mi/mi2-amd64-entry-value.exp: Likewise. * gdb.mi/mi2-var-child.exp: Likewise. * lib/mi-support.exp: Likewise. diff --git a/gdb/testsuite/gdb.mi/mi-break.exp b/gdb/testsuite/gdb.mi/mi-break.exp index 04dd932..d9ab757 100644 --- a/gdb/testsuite/gdb.mi/mi-break.exp +++ b/gdb/testsuite/gdb.mi/mi-break.exp @@ -57,12 +57,10 @@ set fullname "fullname=\"${fullname_syntax}${srcfile}\"" proc test_tbreak_creation_and_listing {} { global srcfile - global hex global line_callee4_head global line_callee3_head global line_callee2_body global line_main_body - global fullname # Insert some breakpoints and list them # Also, disable some so they do not interfere with other tests @@ -73,22 +71,32 @@ proc test_tbreak_creation_and_listing {} { # -break-insert -t srcfile:$line_callee4_head # -break-list - mi_create_breakpoint "-t main" 1 del main ".*basics.c" $line_main_body $hex \ - "break-insert -t operation" - - mi_create_breakpoint "-t basics.c:callee2" 2 del callee2 ".*basics.c" $line_callee2_body $hex \ - "insert temp breakpoint at basics.c:callee2" - - mi_create_breakpoint "-t basics.c:$line_callee3_head" 3 del callee3 ".*basics.c" $line_callee3_head $hex \ - "insert temp breakpoint at basics.c:\$line_callee3_head" - - # Getting the quoting right is tricky. That is "\"\":$line_callee4_head" - mi_create_breakpoint "-t \"\\\"${srcfile}\\\":$line_callee4_head\"" 4 del callee4 ".*basics.c" $line_callee4_head $hex \ - "insert temp breakpoint at \"\":\$line_callee4_head" + set bps {} + lappend bps [mi_create_breakpoint "-t main" "break-insert -t operation" \ + -number 1 -disp del -func main -file ".*basics.c" \ + -line $line_main_body] + + lappend bps [mi_create_breakpoint "-t basics.c:callee2" \ + "insert temp breakpoint at basics.c:callee2" \ + -number 2 -disp del -func callee2 -file ".*basics.c" \ + -line $line_callee2_body] + + lappend bps [mi_create_breakpoint "-t basics.c:$line_callee3_head" \ + "insert temp breakpoint at basics.c:\$line_callee3_head" \ + -number 3 -disp del -func callee3 -file ".*basics.c" \ + -line $line_callee3_head] + + # Getting the quoting right is tricky. + # That is "\"\":$line_callee4_head" + lappend bps [mi_create_breakpoint \ + "-t \"\\\"${srcfile}\\\":$line_callee4_head\"" \ + "insert temp breakpoint at \"\":\$line_callee4_head" \ + -number 4 -disp del -func callee4 -file ".*basics.c" \ + -line $line_callee4_head] mi_gdb_test "666-break-list" \ - "666\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",${fullname},line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}.*\\\]\}" \ - "list of breakpoints" + "666\\\^done,[mi_make_breakpoint_table $bps]" \ + "list of breakpoints" mi_gdb_test "777-break-delete" \ "777\\^done" \ @@ -96,7 +104,6 @@ proc test_tbreak_creation_and_listing {} { } proc test_rbreak_creation_and_listing {} { - global hex global line_callee4_body global line_callee3_body global line_callee2_body @@ -113,29 +120,52 @@ proc test_rbreak_creation_and_listing {} { # -break-list setup_kfail "*-*-*" mi/14270 + set bps {} + lappend bps [mi_make_breakpoint -number 5 -file ".*basics.c" \ + -line $line_main_body] mi_gdb_test "122-break-insert -r main" \ - "122\\^done,bkpt=\{number=\"5\",addr=\"$hex\",file=\".*basics.c\",line=\"$line_main_body\"\}" \ - "break-insert -r operation" + "122\\^done,[lindex $bps end]" \ + "break-insert -r operation" setup_kfail "*-*-*" mi/14270 + lappend bps [mi_make_breakpoint -number 6 -file ".*basics.c" \ + -line $line_callee2_body] mi_gdb_test "133-break-insert -r callee2" \ - "133\\^done,bkpt=\{number=\"6\",addr=\"$hex\",file=\".*basics.c\",line=\"$line_callee2_body\"\}" \ - "insert breakpoint with regexp callee2" + "133\\^done,[lindex $bps end]" \ + "insert breakpoint with regexp callee2" setup_kfail "*-*-*" mi/14270 + set start [llength $bps] + lappend bps [mi_make_breakpoint -number 7 -file ".*basics.c" \ + -line $line_callee1_body] + lappend bps [mi_make_breakpoint -number 8 -file ".*basics.c" \ + -line $line_callee2_body] + lappend bps [mi_make_breakpoint -number 9 -file ".*basics.c" \ + -line $line_callee3_body] + lappend bps [mi_make_breakpoint -number 10 -file ".*basics.c" \ + -line $line_callee4_body] mi_gdb_test "144-break-insert -r callee" \ - "144\\^done,bkpt=\{number=\"7\",addr=\"$hex\",file=\".*basics.c\",line=\"$line_callee1_body\"\},bkpt=\{number=\"8\",addr=\"$hex\",file=\".*basics.c\",line=\"$line_callee2_body\"\},bkpt=\{number=\"9\",addr=\"$hex\",file=\".*basics.c\",line=\"$line_callee3_body\"\},bkpt=\{number=\"10\",addr=\"$hex\",file=\".*basics.c\",line=\"$line_callee4_body\"\}" \ - "insert breakpoint with regexp callee" + "144\\^done,[join [lrange $bps $start end] ,]" \ + "insert breakpoint with regexp callee" setup_kfail "*-*-*" mi/14270 + set start [llength $bps] + lappend bps [mi_make_breakpoint -number 11 -file ".*basics.c" \ + -line $line_callee1_body] + lappend bps [mi_make_breakpoint -number 12 -file ".*basics.c" \ + -line $line_callee2_body] + lappend bps [mi_make_breakpoint -number 13 -file ".*basics.c" \ + -line $line_callee3_body] + lappend bps [mi_make_breakpoint -number 14 -file ".*basics.c" \ + -line $line_callee4_body] mi_gdb_test "155-break-insert -r \.\*llee" \ - "155\\^done,bkpt=\{number=\"11\",addr=\"$hex\",file=\".*basics.c\",line=\"$line_callee1_body\"\},bkpt=\{number=\"12\",addr=\"$hex\",file=\".*basics.c\",line=\"$line_callee2_body\"\},bkpt=\{number=\"13\",addr=\"$hex\",file=\".*basics.c\",line=\"$line_callee3_body\"\},bkpt=\{number=\"14\",addr=\"$hex\",file=\".*basics.c\",line=\"$line_callee4_body\"\}" \ - "insert breakpoint with regexp .*llee" + "155\\^done,[join [lrange $bps $start end] ,]" \ + "insert breakpoint with regexp .*llee" setup_kfail "*-*-*" mi/14270 mi_gdb_test "166-break-list" \ - "1\\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"5\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\"\},.*\}\\\]\}" \ - "list of breakpoints" + "166\\^done,[mi_make_breakpoint_table $bps]" \ + "list of breakpoints" mi_gdb_test "177-break-delete" \ "177\\^done" \ @@ -149,7 +179,7 @@ proc test_abreak_creation {} { "521\\^done,value=\"void\"" "eval tpnum before tracepoint" mi_gdb_test "522-break-insert -a main" \ - "522\\^done,bkpt=\{number=\"10\",type=\"tracepoint\".*\"\}" \ + "522\\^done,[mi_make_breakpoint -number 10 -type tracepoint]" \ "break-insert -a operation" mi_gdb_test "523-var-update tpnum" \ @@ -164,7 +194,7 @@ proc test_ignore_count {} { global line_callme_body mi_gdb_test "-break-insert -i 1 callme" \ - "\\^done.*ignore=\"1\".*" \ + "\\^done,[mi_make_breakpoint -ignore 1]" \ "insert breakpoint with ignore count at callme" mi_run_cmd @@ -204,12 +234,14 @@ proc test_error {} { } proc test_disabled_creation {} { - global hex global line_callee2_body + set bp [mi_make_breakpoint -number 6 -type breakpoint -disp keep \ + -enabled n -func callee2 -file ".*basics.c" \ + -line $line_callee2_body] mi_gdb_test "-break-insert -d basics.c:callee2" \ - "\\^done,bkpt=\{number=\"6\",type=\"breakpoint\",disp=\"keep\",enabled=\"n\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",fullname=\".*\",line=\"$line_callee2_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}" \ - "test disabled creation" + "\\^done,$bp" \ + "test disabled creation" mi_gdb_test "-break-delete" \ "\\^done" \ @@ -218,31 +250,41 @@ proc test_disabled_creation {} { proc test_breakpoint_commands {} { global line_callee2_body - global hex - global fullname - mi_create_breakpoint "basics.c:callee2" 7 keep callee2 ".*basics.c" $line_callee2_body $hex \ - "breakpoint commands: insert breakpoint at basics.c:callee2" + set bp_no_script \ + [mi_create_breakpoint "basics.c:callee2" \ + "breakpoint commands: insert breakpoint at basics.c:callee2" \ + -number 7 -disp keep -func callee2 -file ".*basics.c" \ + -line $line_callee2_body] mi_gdb_test "-break-commands 7 \"print 10\" \"continue\"" \ "\\^done" \ "breakpoint commands: set commands" + # Rebuild the breakpoint regexp instead of using the one returned + # by mi_create_breakpoint. Only in -break-info is the actual script + # seen. + set bp_script [mi_make_breakpoint -number 7 -disp keep -func callee2 \ + -file ".*basics.c" -line $line_callee2_body \ + -script {\{"print 10","continue"\}}] mi_gdb_test "-break-info 7" \ - "\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\}.*colhdr=\"Type\".*colhdr=\"Disp\".*colhdr=\"Enb\".*colhdr=\"Address\".*colhdr=\"What\".*\\\],body=\\\[bkpt=\{number=\"7\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"callee2\",file=\".*basics.c\",${fullname},line=\"$line_callee2_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\",script=\{\"print 10\",\"continue\"\},original-location=\".*\"\}.*\\\]\}" \ + "\\^done,[mi_make_breakpoint_table [list $bp_script]]" \ "breakpoint commands: check that commands are set" mi_gdb_test "-break-commands 7" \ "\\^done" \ "breakpoint commands: clear commands" - mi_list_breakpoints [list [list 7 "keep" "callee2" "basics.c" "$line_callee2_body" $hex]] \ + mi_gdb_test "-break-info" \ + "\\^done,[mi_make_breakpoint_table [list $bp_no_script]]" \ "breakpoint commands: check that commands are cleared" mi_run_to_main - mi_create_breakpoint "basics.c:callee2" 9 keep callee2 ".*basics.c" $line_callee2_body $hex \ - "breakpoint commands: insert breakpoint at basics.c:callee2, again" + mi_create_breakpoint "basics.c:callee2" \ + "breakpoint commands: insert breakpoint at basics.c:callee2, again" \ + -number 9 -disp keep -func callee2 -file ".*basics.c" \ + -line $line_callee2_body mi_gdb_test "-break-commands 9 \"set \$i=0\" \"while \$i<10\" \"print \$i\" \"set \$i=\$i+1\" \"end\" \"continue\" " \ "\\^done" \ diff --git a/gdb/testsuite/gdb.mi/mi-dprintf.exp b/gdb/testsuite/gdb.mi/mi-dprintf.exp index 983acce..d60d66c 100644 --- a/gdb/testsuite/gdb.mi/mi-dprintf.exp +++ b/gdb/testsuite/gdb.mi/mi-dprintf.exp @@ -36,27 +36,38 @@ set dp_location1 [gdb_get_line_number "set dprintf 1 here"] mi_run_to_main -mi_gdb_test "1-dprintf-insert" \ - "1\\^error,msg=\"-dprintf-insert: Missing \"" "mi insert without location" +set i 0 +mi_gdb_test "[incr i]-dprintf-insert" \ + "$i\\^error,msg=\"-dprintf-insert: Missing \"" "mi insert without location" -mi_gdb_test "2-dprintf-insert foo" \ - "2\\^error,msg=\"-dprintf-insert: Missing \"" "mi insert breakpoint without format string" +mi_gdb_test "[incr i]-dprintf-insert foo" \ + "$i\\^error,msg=\"-dprintf-insert: Missing \"" "mi insert breakpoint without format string" -mi_gdb_test "3-dprintf-insert 29" \ - "3\\^error,msg=\"-dprintf-insert: Missing \"" "mi insert second breakpoint without format string" +mi_gdb_test "[incr i]-dprintf-insert 29" \ + "$i\\^error,msg=\"-dprintf-insert: Missing \"" "mi insert second breakpoint without format string" mi_gdb_test "-break-insert main" ".*" "mi insert breakpoint main" mi_delete_breakpoints -mi_gdb_test "4-dprintf-insert foo \"\\\"foobarbazqux\\\" At foo entry\\n\"" \ - "4\\^done,bkpt=\{number=\".*\",type=\"dprintf\".*func=\"foo\",file=\".*mi-dprintf.c\",fullname=\".*mi-dprintf.c\",line=\".*\".*" "mi insert dprintf foo" - -mi_gdb_test "5-dprintf-insert $dp_location1 \"arg=%d, g=%d\\n\" arg g" \ - "5\\^done,bkpt=\{number=\".*\",type=\"dprintf\".*func=\"foo\",file=\".*mi-dprintf.c\",fullname=\".*mi-dprintf.c\",line=\"$dp_location1\".*" \ - "mi insert dprintf dp_location1" - -mi_gdb_test "6-break-info" \ - "6\\^done,BreakpointTable=\{nr_rows=\".\",nr_cols=\".\",hdr=\\\[\{width=\".*\",alignment=\".*\",col_name=\"number\",colhdr=\"Num\"\},\{width=\".*\",alignment=\".*\",col_name=\"type\",colhdr=\"Type\"\},\{width=\".*\",alignment=\".*\",col_name=\"disp\",colhdr=\"Disp\"\},\{width=\".*\",alignment=\".*\",col_name=\"enabled\",colhdr=\"Enb\"\},\{width=\".*\",alignment=\".*\",col_name=\"addr\",colhdr=\"Address\"\},\{width=\".*\",alignment=\".*\",col_name=\"what\",colhdr=\"What\"\}\\\],body=\\\[bkpt=\{number=\"3\",type=\"dprintf\".*func=\"foo\",file=\".*mi-dprintf.c\",fullname=\".*mi-dprintf.c\",line=\".*\".*,bkpt=\{number=\".*\",type=\"dprintf\".*func=\"foo\",file=\".*mi-dprintf.c\",fullname=\".*mi-dprintf.c\",line=\"$dp_location1\".*" \ +set bps [mi_make_breakpoint -type dprintf -func foo -file ".*mi-dprintf.c" \ + -fullname ".*mi-dprintf.c"] +mi_gdb_test "[incr i]-dprintf-insert foo \"\\\"foobarbazqux\\\" At foo entry\\n\"" \ + "$i\\^done,$bps" "mi insert dprintf foo" + +set bps [mi_make_breakpoint -type dprintf -func foo \ + -file ".*mi-dprintf.c" -fullname ".*mi-dprintf.c" \ + -line $dp_location1] +mi_gdb_test "[incr i]-dprintf-insert $dp_location1 \"arg=%d, g=%d\\n\" arg g" \ + "$i\\^done,$bps" "mi insert dprintf dp_location1" + +set bps {} +lappend bps [mi_make_breakpoint -number 3 -type dprintf -func foo \ + -file ".*mi-dprintf.c" -fullname ".*mi-dprintf.c"] +lappend bps [mi_make_breakpoint -type dprintf -func foo \ + -file ".*mi-dprintf.c" -fullname ".*mi-dprintf.c" \ + -line $dp_location1] +mi_gdb_test "[incr i]-break-info" \ + "$i\\^done,[mi_make_breakpoint_table $bps]" \ "mi info dprintf" mi_gdb_test "-break-insert $bp_location1" ".*" "mi insert breakpoint bp_location1" diff --git a/gdb/testsuite/gdb.mi/mi-nonstop.exp b/gdb/testsuite/gdb.mi/mi-nonstop.exp index 03e9798..5ef74ed 100644 --- a/gdb/testsuite/gdb.mi/mi-nonstop.exp +++ b/gdb/testsuite/gdb.mi/mi-nonstop.exp @@ -57,7 +57,8 @@ if { [mi_run_to_main] < 0 } { continue } -mi_create_breakpoint break_at_me 2 keep break_at_me .* .* .* "breakpoint at marker" +mi_create_breakpoint break_at_me "breakpoint at marker" \ + -number 2 -func break_at_me mi_nonstop_resume "exec-continue" "resume 1" mi_expect_stop "breakpoint-hit" "break_at_me" ".*" "non-stop.c" ".*" {"" "disp=\"keep\""} "w0,i0 stop" diff --git a/gdb/testsuite/gdb.mi/mi-nsintrall.exp b/gdb/testsuite/gdb.mi/mi-nsintrall.exp index 1d2a61f..f613e7f 100644 --- a/gdb/testsuite/gdb.mi/mi-nsintrall.exp +++ b/gdb/testsuite/gdb.mi/mi-nsintrall.exp @@ -47,8 +47,9 @@ if { [mi_run_to_main] < 0 } { continue } -mi_create_breakpoint thread_function 2 keep thread_function .* .* .* \ - "breakpoint at thread_function" +mi_create_breakpoint thread_function \ + "breakpoint at thread_function" \ + -number 2 -func thread_function mi_send_resuming_command "exec-continue --all" "resume all" for {set i 0} {$i < 6} {incr i} { diff --git a/gdb/testsuite/gdb.mi/mi-nsmoribund.exp b/gdb/testsuite/gdb.mi/mi-nsmoribund.exp index f03aaf1..350c060 100644 --- a/gdb/testsuite/gdb.mi/mi-nsmoribund.exp +++ b/gdb/testsuite/gdb.mi/mi-nsmoribund.exp @@ -55,8 +55,9 @@ set nthreads 10 set bkpt_line [gdb_get_line_number "set breakpoint here"] -mi_create_breakpoint "$srcfile:$bkpt_line" 2 keep thread_function .* .* .* \ - "breakpoint at thread_function" +mi_create_breakpoint "$srcfile:$bkpt_line" \ + "breakpoint at thread_function" \ + -number 2 -function thread_function mi_send_resuming_command "exec-continue --all" "resume all" for {set i 0} {$i < $nthreads} {incr i} { diff --git a/gdb/testsuite/gdb.mi/mi-nsthrexec.exp b/gdb/testsuite/gdb.mi/mi-nsthrexec.exp index 03764ea..85617d0 100644 --- a/gdb/testsuite/gdb.mi/mi-nsthrexec.exp +++ b/gdb/testsuite/gdb.mi/mi-nsthrexec.exp @@ -57,8 +57,9 @@ if { [mi_run_to_main] < 0 } { continue } -mi_create_breakpoint thread_execler 2 keep thread_execler .* .* .* \ - "breakpoint at thread_execler" +mi_create_breakpoint thread_execler \ + "breakpoint at thread_execler" \ + -number 2 -function thread_execler # All threads should stop, except the main thread. mi_send_resuming_command "exec-continue --all" "resume all" @@ -77,8 +78,10 @@ mi_check_thread_states {"stopped" "stopped"} "thread state, all stopped" # now that we know about all the threads, we can get rid of the breakpoints mi_delete_breakpoints -mi_create_breakpoint main 3 keep main .* .* .* \ - "breakpoint at main" +mi_create_breakpoint main \ + "breakpoint at main" \ + -number 3 -func main + # Now resume the execler thread. Eventually, it execs. mi_send_resuming_command "exec-continue --thread 2" "resume execler thread" diff --git a/gdb/testsuite/gdb.mi/mi-reverse.exp b/gdb/testsuite/gdb.mi/mi-reverse.exp index 20a84e4..a8c26c4 100644 --- a/gdb/testsuite/gdb.mi/mi-reverse.exp +++ b/gdb/testsuite/gdb.mi/mi-reverse.exp @@ -151,8 +151,9 @@ proc test_controlled_execution_reverse {} { # Test exec-reverse-continue mi_create_breakpoint "-t basics.c:$line_callee3_head" \ - 3 del callee3 ".*basics.c" $line_callee3_head $hex \ - "insert temp breakpoint at basics.c:$line_callee3_head" + "insert temp breakpoint at basics.c:$line_callee3_head" \ + -number 3 -disp del -func callee3 -file ".*basics.c" \ + -line $line_callee3_head mi_execute_to "exec-continue --reverse" \ "breakpoint-hit" "callee3" \ diff --git a/gdb/testsuite/gdb.mi/mi-simplerun.exp b/gdb/testsuite/gdb.mi/mi-simplerun.exp index 7d5baa6..5e57d9b 100644 --- a/gdb/testsuite/gdb.mi/mi-simplerun.exp +++ b/gdb/testsuite/gdb.mi/mi-simplerun.exp @@ -46,7 +46,6 @@ mi_gdb_load ${binfile} proc test_breakpoints_creation_and_listing {} { global srcfile - global hex set line_callee4_head [gdb_get_line_number "callee4 ("] set line_callee4_body [expr $line_callee4_head + 2] @@ -65,29 +64,40 @@ proc test_breakpoints_creation_and_listing {} { # -break-disable # -break-info - mi_create_breakpoint "main" 1 keep main ".*basics.c" $line_main_body $hex \ - "break-insert operation" + set bps {} + lappend bps [mi_create_breakpoint "main" \ + "break-insert operation" \ + -number 1 -func main -file ".*basics.c" \ + -line $line_main_body] - mi_create_breakpoint "basics.c:callee2" 2 keep callee2 ".*basics.c" $line_callee2_body $hex \ - "insert breakpoint at basics.c:callee2" + lappend bps [mi_create_breakpoint "basics.c:callee2" \ + "insert breakpoint at basics.c:callee2" \ + -number 2 -func callee2 -file ".*basics.c" \ + -line $line_callee2_body] - mi_create_breakpoint "basics.c:$line_callee3_head" 3 keep callee3 ".*basics.c" $line_callee3_head $hex \ - "insert breakpoint at basics.c:\$line_callee3_head" + lappend bps [mi_create_breakpoint "basics.c:$line_callee3_head" \ + "insert breakpoint at basics.c:\$line_callee3_head" \ + -number 3 -func callee3 -file ".*basics.c" \ + -line $line_callee3_head] - mi_create_breakpoint "\"\\\"${srcfile}\\\":$line_callee4_head\"" 4 keep callee4 ".*basics.c" $line_callee4_head $hex \ - "insert breakpoint at \"\":\$line_callee4_head" + lappend bps [mi_create_breakpoint \ + "\"\\\"${srcfile}\\\":$line_callee4_head\"" \ + "insert breakpoint at \"\":\$line_callee4_head" \ + -number 4 -func callee4 -file ".*basics.c" \ + -line $line_callee4_head] mi_gdb_test "204-break-list" \ - "204\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"$hex\",func=\"main\",file=\".*basics.c\",line=\"$line_main_body\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\},.*\}\\\]\}" \ - "list of breakpoints" + "204\\^done,[mi_make_breakpoint_table $bps]" \ + "list of breakpoints" mi_gdb_test "205-break-disable 2 3 4" \ "205\\^done.*" \ "disabling of breakpoints" + set bp2 [mi_make_breakpoint -number 2 -enabled n] mi_gdb_test "206-break-info 2" \ - "206\\^done,BreakpointTable=\{.*,hdr=\\\[.*\\\],body=\\\[bkpt=\{number=\"2\",.*,enabled=\"n\",.*\}\\\]\}" \ - "list of breakpoints, 16 disabled" + "206\\^done,[mi_make_breakpoint_table [list $bp2]]"\ + "list of breakpoints, 16 disabled" } proc test_running_the_program {} { diff --git a/gdb/testsuite/gdb.mi/mi-stepn.exp b/gdb/testsuite/gdb.mi/mi-stepn.exp index 17b682c..050bb50 100644 --- a/gdb/testsuite/gdb.mi/mi-stepn.exp +++ b/gdb/testsuite/gdb.mi/mi-stepn.exp @@ -35,8 +35,9 @@ if {[mi_run_to_main] < 0} { return -1 } -mi_create_breakpoint do_nothing 2 keep do_nothing .* .* .* \ - "breakpoint at do_nothing" +mi_create_breakpoint do_nothing \ + "breakpoint at do_nothing" \ + -number 2 -func do_nothing mi_send_resuming_command "exec-step 3" "" mi_expect_stop "breakpoint-hit" "do_nothing" "\[^\n\]*" "$srcfile" \ diff --git a/gdb/testsuite/gdb.mi/mi-syn-frame.exp b/gdb/testsuite/gdb.mi/mi-syn-frame.exp index 08193ec..2db7f52 100644 --- a/gdb/testsuite/gdb.mi/mi-syn-frame.exp +++ b/gdb/testsuite/gdb.mi/mi-syn-frame.exp @@ -35,8 +35,9 @@ mi_gdb_exit mi_gdb_start mi_run_to_main -mi_create_breakpoint "foo" 2 keep foo ".*mi-syn-frame.c" $decimal $hex \ - "insert breakpoint foo" +mi_create_breakpoint "foo" \ + "insert breakpoint foo" \ + -number 2 -func foo -file ".*mi-syn-frame.c" # # Call foo() by hand, where we'll hit a breakpoint. @@ -64,8 +65,9 @@ mi_gdb_test "404-stack-list-frames 0 0" \ # Call have_a_very_merry_interrupt() which will eventually raise a signal # that's caught by handler() which calls subroutine(). -mi_create_breakpoint "subroutine" 3 keep subroutine ".*mi-syn-frame.c" $decimal $hex \ - "insert breakpoint subroutine" +mi_create_breakpoint "subroutine" \ + "insert breakpoint subroutine" \ + -number 3 -func subroutine -file ".*mi-syn-frame.c" mi_gdb_test "406-data-evaluate-expression have_a_very_merry_interrupt()" \ ".*406\\^error,msg=\"The program being debugged stopped while in a function called from GDB.\\\\nEvaluation of the expression containing the function\\\\n\\(have_a_very_merry_interrupt\\) will be abandoned.\\\\nWhen the function is done executing, GDB will silently stop.\"" \ diff --git a/gdb/testsuite/gdb.mi/mi-until.exp b/gdb/testsuite/gdb.mi/mi-until.exp index 4705474..3fabcd2 100644 --- a/gdb/testsuite/gdb.mi/mi-until.exp +++ b/gdb/testsuite/gdb.mi/mi-until.exp @@ -42,11 +42,9 @@ mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_load ${binfile} proc test_running_to_foo {} { - global mi_gdb_prompt - global hex - - mi_create_breakpoint "10" 1 "keep" foo ".*until.c" 10 ".*" \ - "break-insert operation" + mi_create_breakpoint "10" \ + "break-insert operation" \ + -number 1 -func foo -file ".*until.c" -line 10 mi_run_cmd mi_expect_stop "breakpoint-hit" "foo" "" ".*until.c" 10 \ @@ -57,9 +55,6 @@ proc test_running_to_foo {} { } proc test_until {} { - global mi_gdb_prompt - global hex fullname_syntax srcfile - setup_kfail gdb/2104 "*-*-*" mi_execute_to "exec-until" "end-stepping-range" "foo" "" ".*until.c" "12" "" \ "until after while loop" diff --git a/gdb/testsuite/gdb.mi/mi-var-cp.exp b/gdb/testsuite/gdb.mi/mi-var-cp.exp index 713cce9..a201156 100644 --- a/gdb/testsuite/gdb.mi/mi-var-cp.exp +++ b/gdb/testsuite/gdb.mi/mi-var-cp.exp @@ -45,9 +45,10 @@ mi_run_inline_test reference_to_struct mi_run_inline_test path_expression set lineno [gdb_get_line_number "/* anonymous_structs_and_unions */"] -mi_create_breakpoint \ - "$srcfile:$lineno" {[0-9]+} keep {anonymous_structs_and_unions\(\)} \ - ".*mi-var-cp.cc" $lineno $hex "break in anonymous_structs_and_unions" +mi_create_breakpoint "$srcfile:$lineno" \ + "break in anonymous_structs_and_unions" \ + -func {anonymous_structs_and_unions\(\)} -file ".*mi-var-cp.cc" \ + -line $lineno mi_execute_to "exec-continue" "breakpoint-hit" \ "anonymous_structs_and_unions" "" ".*" ".*" {"" "disp=\"keep\""} \ "continue to anonymous_structs breakpoint" diff --git a/gdb/testsuite/gdb.mi/mi-var-display.exp b/gdb/testsuite/gdb.mi/mi-var-display.exp index c809d85..d20c6f0 100644 --- a/gdb/testsuite/gdb.mi/mi-var-display.exp +++ b/gdb/testsuite/gdb.mi/mi-var-display.exp @@ -40,8 +40,10 @@ mi_gdb_load ${binfile} set line_dct_end [gdb_get_line_number "{int a = 0;}"] -mi_create_breakpoint "$srcfile:$line_dct_end" 1 keep do_children_tests ".*var-cmd.c" $line_dct_end $hex \ - "break-insert operation" +mi_create_breakpoint "$srcfile:$line_dct_end" \ + "break-insert operation" \ + -number 1 -func do_children_tests -file ".*var-cmd.c" \ + -line $line_dct_end mi_run_cmd mi_expect_stop "breakpoint-hit" "do_children_tests" "" ".*var-cmd.c" \ @@ -368,8 +370,10 @@ mi_gdb_test "-var-delete weird" \ set line_dst_incr_a_2 [gdb_get_line_number "incr_a(2);"] -mi_create_breakpoint "$line_dst_incr_a_2" 2 keep do_special_tests ".*var-cmd.c" $line_dst_incr_a_2 $hex \ - "break-insert operation 2" +mi_create_breakpoint "$line_dst_incr_a_2" \ + "break-insert operation 2" \ + -number 2 -func do_special_tests -file ".*var-cmd.c" \ + -line $line_dst_incr_a_2 mi_execute_to "exec-continue" "breakpoint-hit" "do_special_tests" "" \ ".*var-cmd.c" $line_dst_incr_a_2 { "" "disp=\"keep\"" } \ diff --git a/gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp b/gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp index 0d2976a..acb2aba 100644 --- a/gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp +++ b/gdb/testsuite/gdb.mi/mi2-amd64-entry-value.exp @@ -43,7 +43,7 @@ mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_load ${binfile} foreach name {different breakhere_different breakhere_validity breakhere_invalid} { - mi_create_breakpoint $name .* .* .* .* .* .* "break $name" + mi_create_breakpoint $name "break $name" } diff --git a/gdb/testsuite/gdb.mi/mi2-var-child.exp b/gdb/testsuite/gdb.mi/mi2-var-child.exp index d2f65c5..f992a63 100644 --- a/gdb/testsuite/gdb.mi/mi2-var-child.exp +++ b/gdb/testsuite/gdb.mi/mi2-var-child.exp @@ -1160,8 +1160,9 @@ proc verify_everything {variable_name} { set lineno [gdb_get_line_number "anonymous type tests breakpoint"] mi_create_breakpoint \ - "$srcfile:$lineno" {[0-9]+} keep {do_anonymous_type_tests} \ - ".*var-cmd.c" $lineno $hex "break in do_anonymous_type_tests" + "$srcfile:$lineno" "break in do_anonymous_type_tests" \ + -disp keep -func do_anonymous_type_tests \ + -file ".*var-cmd.c" -line $lineno mi_execute_to "exec-continue" "breakpoint-hit" "do_anonymous_type_tests" ""\ ".*" ".*" {"" "disp=\"keep\""} \ "continue to do_anonymous_type_tests breakpoint" diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp index b8d9995..b2e926f 100644 --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -937,14 +937,10 @@ proc mi_runto_helper {func run_or_continue} { global hex decimal fullname_syntax set test "mi runto $func" - mi_gdb_test "200-break-insert -t $func" \ - "200\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"$func\(\\\(.*\\\)\)?\",file=\".*\",line=\"\[0-9\]*\",thread-groups=\\\[\"i1\"\\\],times=\"0\",original-location=\".*\"\}" \ - "breakpoint at $func" - - if {![regexp {number="[0-9]+"} $expect_out(buffer) str] - || ![scan $str {number="%d"} bkptno]} { - set bkptno {[0-9]+} - } + set bp [mi_make_breakpoint -type breakpoint -disp del \ + -func $func\(\\\(.*\\\)\)?] + mi_gdb_test "200-break-insert -t $func" "200\\^done,$bp" \ + "breakpoint at $func" if {$run_or_continue == "run"} { if { [mi_run_cmd] < 0 } {