From patchwork Tue Apr 11 11:19:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 67629 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 482FF3858D39 for ; Tue, 11 Apr 2023 11:19:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 482FF3858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1681211992; bh=eFtlZrlkSif9An4eHxJ7lbf1NmipgGGnrSJZNjOf9OY=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=mIOeXe76FIeG7dlcpbu2hdq2SXX2KjJ/paKruhfCoYL+79l9P49l0Grk7pPSfUZL5 NjbxSGAS5yI9ATjdeRqG5/z20bLH4+unMRuxqE+sCIENsY/XhHbf2/MK6nWxXkc7bx qvkLTOg27WkGsJTjSTDZnOK720p73j01IO5LOI4Q= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 CED083858D28 for ; Tue, 11 Apr 2023 11:19:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CED083858D28 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-295-QdCMRKw5NxCcgjIJ0feRbA-1; Tue, 11 Apr 2023 07:19:22 -0400 X-MC-Unique: QdCMRKw5NxCcgjIJ0feRbA-1 Received: by mail-ej1-f70.google.com with SMTP id tg11-20020a1709078dcb00b0093460dfa569so2461589ejc.13 for ; Tue, 11 Apr 2023 04:19:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681211961; 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=eFtlZrlkSif9An4eHxJ7lbf1NmipgGGnrSJZNjOf9OY=; b=nanl01RJfqJAxhQWUajZkwShrO5dwYjCRRxMnEINfyA3W0Gbd0Mw1C7gyvCyj2yESE x12zVPM8tzKKdmO2ftszTX73+HJA3IsrnuQFRQJKzpNbbGc33tSDpV1E6e7zdSBP6Q1C isRuVc4cnOVjz1DwFMWJJy7oo10gnn1rfwLpWLtEbTPaSNlJzyFak9Jd3R8kACEnO0Vz HKI19HOcvsXFZBCSCDgvud8eSGwViHKARIbv6IXWfDN+HXy2Dxmyz59jPraMUD26Yv4T 0QLmtsx3nxVry5doxPXOIT7bJUk+suw3+sjuXYMGrOUy0Kv1rwgsykRQ2nCnr3cI6q19 SQOg== X-Gm-Message-State: AAQBX9c9LhAbfwIm5zXLb0jRt5u7sjRxDqHXnfKipMItXB99iVTP4nKr 07de0eNWX3TOJCBeU0EyGi+sDMFOvjSS5A+wqDPUadRytyGdi/mBREo6T6BwZ8KHzojhJ5sDNu7 /tYNp+kMM2EpMOrg+X6DfMKXcs0TWYcVmJcoKQrj5T8xIFW4O9n6d8FXNhiTpfcQPFoAXoMzF3Y CEHQ7Q4g== X-Received: by 2002:a17:906:454a:b0:94a:5602:5d6a with SMTP id s10-20020a170906454a00b0094a56025d6amr2124145ejq.9.1681211960978; Tue, 11 Apr 2023 04:19:20 -0700 (PDT) X-Google-Smtp-Source: AKy350YAIg0jCKFnr9Pf+B9aa4n4rstCJR0tY/aeoYSasO2JT5FrNteeAu8VEQ+Y/JCrL7ewwIDezg== X-Received: by 2002:a17:906:454a:b0:94a:5602:5d6a with SMTP id s10-20020a170906454a00b0094a56025d6amr2124124ejq.9.1681211960604; Tue, 11 Apr 2023 04:19:20 -0700 (PDT) Received: from localhost (95.72.115.87.dyn.plus.net. [87.115.72.95]) by smtp.gmail.com with ESMTPSA id s14-20020a50d48e000000b004faa1636758sm5708373edi.68.2023.04.11.04.19.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Apr 2023 04:19:20 -0700 (PDT) To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 1/2] gdb/testsuite: avoid {"} pattern in lib/mi-support.exp Date: Tue, 11 Apr 2023 12:19:15 +0100 Message-Id: <8698a0544ca9c9441a4dc0c459ca3944532140ba.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 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Andrew Burgess via Gdb-patches From: Andrew Burgess Reply-To: Andrew Burgess Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" Commit: commit c569a946f6925d3f210c3eaf74dcda56843350ef Date: Fri Mar 24 10:45:37 2023 +0100 [gdb/testsuite] Fix unbalanced quotes in mi_expect_stop argument Introduced the use of {"} in mi-support.exp. There is absolutely nothing wrong with this in any way. However, this is causing my editor to get the syntax highlighting of this file wrong after this point. Maybe the real answer is to use a better editor, or fix my current editor.... but I'm hoping I can instead take the lazy approach of just changing {"} to "\"", which is handled fine, and means exactly the same as far as I understand it. There should be no change in what is tested after this commit. Reviewed-By: Tom Tromey --- gdb/testsuite/lib/mi-support.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp index 1841816ffeb..52c188df49d 100644 --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -1271,7 +1271,7 @@ proc mi_expect_stop { reason func args file line extra test } { set r "" if { $reason != "" } { - if { [regexp {"} $reason] } { + if { [regexp "\"" $reason] } { set r "reason=$reason," } else { set r "reason=\"$reason\"," From patchwork Tue Apr 11 11:19:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 67630 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BF07F385842C for ; Tue, 11 Apr 2023 11:20:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BF07F385842C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1681212020; bh=GD3XLA0Apx7T8L2H4Xs+7poKzBWVGhAxDNZIU0Q8ixQ=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=GNNR1TgQ2VfsSo7T6ZLC/fKbxVDuWJiwEphXhUH6Xqixn3IuvXSpgi0JKHyGVLkiR 2YNvFBwPJ9sSeiyfmAkWqflvATYJpQOQhEu/OyjwPzHbX+pLAwtB/eLXH91HCzbU/c 28qspUkLDZkyPl7skRbW0AnzG9jUyCcuMXVxnasU= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 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) 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 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Andrew Burgess via Gdb-patches From: Andrew Burgess Reply-To: Andrew Burgess Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" 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. Reviewed-By: Tom Tromey --- 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 \