From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 8410D3858C2D for ; Tue, 11 Apr 2023 11:19:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8410D3858C2D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681211965; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GD3XLA0Apx7T8L2H4Xs+7poKzBWVGhAxDNZIU0Q8ixQ=; b=jA+UBD9kdNn/p9Na1pjecyc961Lb/fWJiqTISjhlaWviiQBDNN7+X4B4Bv7BW/03VQ5a61 gZooVKW2ZCmYpHrCESZTUZSn2G+NAH2ANFB2mC/C1M+njVZaEZy3MpOpVGzcSiFbOR1ODC xyzk4e9+NMG3KHeZJdaTMt/kNGOLGDs= Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-553-NeCIqgviPsOB8R4Gla873A-1; Tue, 11 Apr 2023 07:19:24 -0400 X-MC-Unique: NeCIqgviPsOB8R4Gla873A-1 Received: by mail-ej1-f70.google.com with SMTP id a640c23a62f3a-94a4eba1887so84052166b.0 for ; Tue, 11 Apr 2023 04:19:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681211962; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GD3XLA0Apx7T8L2H4Xs+7poKzBWVGhAxDNZIU0Q8ixQ=; b=RF7HSf8ogY5O8zkCnpADBOneGwmUAE37Qy1Om8TR4BY3PAeF7sFh6ZrW55yTy+F7RU SLSnFpzh5vkwbFDycvRfgDZvWc7gFRK1P0Vs1a8RjCxapTIMZQ82OxuVTeFY2us7+Oe6 UYmB7F+wsCLvGMYrL1GNyUwpg1x/jSitnOVOMNutmsmfqYxjZHqc1vSyPeYynDwzApyG vNsg9O99h4f4dNtqwl/qPUuy6RX7T//RFI4XLCVVDz06KFYZaqFNhPDa1/dRo7qvrLMG o7K6NjCzv8BKBeH4Ry5bkco8+pgorcC0pM2DDekp4qOGg5vz9EQ6/+d+dM0/eSg23yOV o/YA== X-Gm-Message-State: AAQBX9cja7XJ29ngREeRjPdei/JYSoYpb+04FP3qzC5PzuknnJEmwn5U qImPhuEhkt+MIa6rB8dEu2Zm8qwai15siUB59ls7WIXLDxP01GLgO2UePXz4cwfFtPoLT5kZTfB OkTra45WRi4Nmjk1C/8c61Adp9GV3AEnDi+dGvbZAzJoN9TlZd0leHWjHWCsgZstDd+hfZVOgcD H5rClFfw== X-Received: by 2002:aa7:d5d5:0:b0:504:9346:11d3 with SMTP id d21-20020aa7d5d5000000b00504934611d3mr1848834eds.29.1681211962500; Tue, 11 Apr 2023 04:19:22 -0700 (PDT) X-Google-Smtp-Source: AKy350ZJQyJ3jscNWEvhrjqL6ULOo/AiqczU4854OLiXTKlYdiM5CUS/4rCk8mWEi0IPo19Wkh0llA== X-Received: by 2002:aa7:d5d5:0:b0:504:9346:11d3 with SMTP id d21-20020aa7d5d5000000b00504934611d3mr1848814eds.29.1681211962053; Tue, 11 Apr 2023 04:19:22 -0700 (PDT) Received: from localhost (95.72.115.87.dyn.plus.net. [87.115.72.95]) by smtp.gmail.com with ESMTPSA id n19-20020a509353000000b005002daeb27asm5861144eda.37.2023.04.11.04.19.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Apr 2023 04:19:21 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 2/2] gdb/testsuite: accept script argument for mi_make_breakpoint_pending Date: Tue, 11 Apr 2023 12:19:16 +0100 Message-Id: <86d8058f882e24a361ed7ae385b3bfc02fadfc0c.1681211875.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This commit changes mi_make_breakpoint_pending to accept the 'script' and 'times' arguments. I've then added a new test that makes use of 'scripts' in gdb.mi/mi-pending.exp and gdb.mi/mi-dprintf-pending.exp. There is already a test in gdb.mi/mi-pending.exp that uses the 'times' argument -- previously this argument was being ignored, but is now used. --- gdb/testsuite/gdb.mi/mi-dprintf-pending.exp | 6 ++++-- gdb/testsuite/gdb.mi/mi-pending.exp | 15 +++++++++++++++ gdb/testsuite/lib/mi-support.exp | 5 ++--- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/gdb/testsuite/gdb.mi/mi-dprintf-pending.exp b/gdb/testsuite/gdb.mi/mi-dprintf-pending.exp index 358d929f1bb..28f52938aeb 100644 --- a/gdb/testsuite/gdb.mi/mi-dprintf-pending.exp +++ b/gdb/testsuite/gdb.mi/mi-dprintf-pending.exp @@ -48,9 +48,11 @@ mi_load_shlibs $lib_sl1 set bp_location1 [gdb_get_line_number "set breakpoint 1 here"] # Set pending dprintf via MI. +set bp [mi_make_breakpoint_pending -number "1" -type "dprintf" \ + -disp "keep" -enabled "y" -pending "pendfunc1" \ + -original-location "pendfunc1"] mi_gdb_test "-dprintf-insert -f pendfunc1 \"hello\"" \ - ".*\\^done,bkpt={number=\"1\",type=\"dprintf\",disp=\"keep\",enabled=\"y\",addr=\"\",pending=\"pendfunc1\",times=\"0\",original-location=\"pendfunc1\"}" \ - "mi set dprintf" + ".*\\^done,$bp" "mi set dprintf" mi_create_breakpoint $bp_location1 "mi insert breakpoint bp_location1" \ -type "breakpoint" -line $bp_location1 -file ".*$srcfile" diff --git a/gdb/testsuite/gdb.mi/mi-pending.exp b/gdb/testsuite/gdb.mi/mi-pending.exp index 71c3d45fe44..79f0db8e35e 100644 --- a/gdb/testsuite/gdb.mi/mi-pending.exp +++ b/gdb/testsuite/gdb.mi/mi-pending.exp @@ -61,6 +61,21 @@ mi_create_breakpoint_pending "-f pendfunc1" \ -pending "pendfunc1" \ -original-location "pendfunc1" +# Add some commands to the pending breakpoint, use -break-info to +# check that the commands show up, then clear the commands again. +mi_gdb_test "-break-commands 1 \"print 1\" \"print 2\" \"print 3\""\ + "\\^done" \ + "set breakpoint commands on pending breakpoint" +set bp [mi_make_breakpoint_pending -number 1 -disp keep -func pendfunc1 \ + -disp keep -enabled y -original-location pendfunc1 \ + -script {\["print 1","print 2","print 3"\]}] +mi_gdb_test "-break-info 1" \ + "\\^done,[mi_make_breakpoint_table [list $bp]]" \ + "breakpoint commands: check that commands are set" +mi_gdb_test "-break-commands 1"\ + "\\^done" \ + "clear breakpoint commands on pending breakpoint" + # Set pending breakpoint with a condition via MI. mi_create_breakpoint_pending "-f -c x==4 ${libfile1}.c:pendfunc2" \ "MI pending breakpoint on ${libfile1}.c:pendfunc2 if x==4" \ diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp index 52c188df49d..0d830d8e4ae 100644 --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -2685,7 +2685,8 @@ proc mi_make_breakpoint_multi {args} { proc mi_make_breakpoint_pending {args} { parse_args {{number .*} {type .*} {disp .*} {enabled .*} - {pending .*} {original-location .*} {thread ""} {cond ""}} + {pending .*} {original-location .*} {thread ""} {cond ""} + {script ""} {times .*}} set attr_list {} foreach attr [list number type disp enabled] { @@ -2699,8 +2700,6 @@ proc mi_make_breakpoint_pending {args} { } set ignore 0 - set times 0 - set script "" set evaluated-by "" set result [mi_make_breakpoint_1 \ -- 2.25.4