From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2042.outbound.protection.outlook.com [40.107.93.42]) by sourceware.org (Postfix) with ESMTPS id 441E0386DC63 for ; Mon, 20 Jun 2022 17:19:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 441E0386DC63 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aZSUOT1Sa8qbGQ4cka9BcoqN63W/JG6XZCABqtoAoSMzYOTHlZCYwet2BDfSYNpSxtHSB975DuWwT5yAfz8VTEjeKebRYBm9IwCUEdAAeFLdV9QdWyDZMj2kiEJKNyu/iKXOdUCKsJTUCwITeN0nVa/NvV0PoywCa1HXptZdn3yuM9WYYFJw80F+uAeAUo5gl630GqDmv8A+esPCTJnj+MAnh9tZVNKjPZJ0aaDw6Jync70hgIIqQ2H9GFNW4TNKtQVt7nYMl8jeQSnPTZzZ7LAwCaXI3plxSoG3DQ7ls7BKkIw5hanG448UANOPSpz4+NOuq8DvS3Qpbdi39joaTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=t9YgCE92UgugD4YsEd+NyYs6xMVkNDHs73w5TB/1BJY=; b=Qem3ZSf0/aMXKUN8O7IqItuao6+ggTJEJkTg04FofT/3nnS0MkqU79zdbOlrOLiSyn87+G2i2OoXz0Anxe6TwwY58Pl1yyZAcd3vUmADXXN4uvIhAadmJxUPqE5HQffQzvr0/1eLs1m/4tgyFoMFe1TkEea7qS8Ve2fWpbTcegUHp33miB1BqMQF1XpAl4tW2bUveU5LmWqaj1bbTFlqmN3kJ0M7pAH4yuqXUc1yZsts2GPg8fM+s0aG0saPk37IPIuXyYu6sF2iL/wWSmUR339iIOxbM8XzvN/zNyO1d9Kl1wF4FZQgwnuRfr1x0R2GKq/Wgg/2T7I7ej1qa9WMEQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=sourceware.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none Received: from MW3PR06CA0007.namprd06.prod.outlook.com (2603:10b6:303:2a::12) by DM5PR1201MB0156.namprd12.prod.outlook.com (2603:10b6:4:59::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.18; Mon, 20 Jun 2022 17:19:37 +0000 Received: from CO1NAM11FT067.eop-nam11.prod.protection.outlook.com (2603:10b6:303:2a:cafe::1) by MW3PR06CA0007.outlook.office365.com (2603:10b6:303:2a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.21 via Frontend Transport; Mon, 20 Jun 2022 17:19:37 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT067.mail.protection.outlook.com (10.13.174.212) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5353.14 via Frontend Transport; Mon, 20 Jun 2022 17:19:37 +0000 Received: from khazad-dum.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Mon, 20 Jun 2022 12:19:35 -0500 From: Lancelot SIX To: CC: , Pedro Alves Subject: [PATCH v2 1/3] MI: mi_runto -pending Date: Mon, 20 Jun 2022 18:19:13 +0100 Message-ID: <20220620171915.509358-2-lancelot.six@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220620171915.509358-1-lancelot.six@amd.com> References: <20220620171915.509358-1-lancelot.six@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 96eba6ec-7c55-49c0-b770-08da52e10d9e X-MS-TrafficTypeDiagnostic: DM5PR1201MB0156:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H2ySERkKuzTX0APgRojDtHNJRVUIpM+PFzDULk/H3kvbC+Rc0EVqxNetjT1YudFbSVzSTWZ+v1xvGRNbsUOw9bPwFRfUZMGl30vMLAEvOeHBP3U06OwgKl73LDbLZv6aLZ5OmWPO5QlAfwFuEKqKmpHSdQF3GDOFlTp8rXZzdHUAItS+CZJy1n7DOb6NNKS13Xs6IL3ii7Pp8/9w6R0UpwxdtzQsstW2nmj6zCir1C8k/CuZ8AOa4SsJG5N42HxpdEFs9YRfPkeCm1XZTXTp8uBydAXCjro+/3BNPeFBlznQLgz4KTr4TxDkKrSB7sNOeEHgJeIhkSmrp/FTxTWliY2i2QDzbQNw1ZKieASx9caYcl2a0mJf1v6PTN6ydT6kG/MyUtP5811VkmbVIgeUhRuhU5bThIHyyqmt/XfBbxa3lojXis3HdTuasM3Mrj9GRCMtp+lDQVkeolk24SBLY/U1gVO5gh8N7FhCBOyg0kGZwoJNVDNRTZ2YO48869PheWgRXCdpA4mSgeDy9lYUonSiqBpbCzlTjOOoMZ/01BcXHvXDhI587P2WdvClnK9rzJApds0M0Yp5zuOBSrE6pFb1wdD9U3zcEeNBHn5xhzDgHxwd8na6qe8ec2IilUvK84x2Yju12aBEmW749yV/G9E2wXjvk2dbC8oRZNJqX4WVoQTdQ8lSXlL1ybZz2cCjtJMf3ME9KID9MhHUZOi7BUYcYMVxvpwJSaIsgO7GncrJwaXLHcD0AWeeHjs41GQ1xsAfkE30DUhB4gNR2ZBz1Q== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(136003)(346002)(376002)(396003)(39860400002)(36840700001)(46966006)(40470700004)(5660300002)(478600001)(40480700001)(8936002)(36860700001)(81166007)(2616005)(336012)(82740400003)(47076005)(186003)(16526019)(40460700003)(426003)(83380400001)(41300700001)(6666004)(356005)(6916009)(86362001)(36756003)(7696005)(26005)(54906003)(2906002)(4326008)(1076003)(70586007)(70206006)(316002)(8676002)(82310400005)(403724002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2022 17:19:37.4096 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 96eba6ec-7c55-49c0-b770-08da52e10d9e X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT067.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0156 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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-List-Received-Date: Mon, 20 Jun 2022 17:19:42 -0000 From: Pedro Alves With the CLI testsuite's runto proc, we can pass "allow-pending" as an option, like: runto func allow-pending That is currently not possible with MI's mi_runto, however. This patch makes it possible, by adding a new "-pending" option to mi_runto. A pending breakpoint shows different MI attributes compared to a breakpoint with a location, so the regexp returned by mi_make_breakpoint isn't suitable. Thus, add a new mi_make_breakpoint_pending proc for pending breakpoints. Tweak mi_runto to let it take and pass down arguments. Change-Id: I185fef00ab545a1df2ce12b4dbc3da908783a37c --- gdb/testsuite/lib/mi-support.exp | 68 ++++++++++++++++++++++++++++---- 1 file changed, 61 insertions(+), 7 deletions(-) diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp index e578a7e6f9b..ca56e12b06b 100644 --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -1114,21 +1114,34 @@ proc mi_clean_restart { args } { # Supported options: # # -qualified -- pass --qualified to -break-insert +# -pending -- pass -f to -break-insert to create a pending +# breakpoint. proc mi_runto_helper {func run_or_continue args} { global mi_gdb_prompt expect_out global hex decimal fullname_syntax - parse_args {{qualified}} + parse_args {{qualified} {pending}} set test "mi runto $func" - set bp [mi_make_breakpoint -type breakpoint -disp del \ - -func $func\(\\\(.*\\\)\)?] + if {$pending} { + set bp [mi_make_breakpoint_pending -type breakpoint -disp del] + } else { + set bp [mi_make_breakpoint -type breakpoint -disp del \ + -func $func\(\\\(.*\\\)\)?] + } set extra_opts "" + set extra_output "" if {$qualified} { - append extra_opts "--qualified" + lappend extra_opts "--qualified" } - mi_gdb_test "200-break-insert $extra_opts -t $func" "200\\^done,$bp" \ + if {$pending} { + lappend extra_opts "-f" + # MI prints "Function FUNC not defined", "No line NNN in current + # file.", etc. to the CLI stream. + set extra_output "&\"\[^\r\n\]+\"\r\n" + } + mi_gdb_test "200-break-insert [join $extra_opts " "] -t $func" "${extra_output}200\\^done,$bp" \ "breakpoint at $func" if {$run_or_continue == "run"} { @@ -1142,8 +1155,8 @@ proc mi_runto_helper {func run_or_continue args} { mi_expect_stop "breakpoint-hit" $func ".*" ".*" "\[0-9\]+" { "" "disp=\"del\"" } $test } -proc mi_runto {func} { - return [mi_runto_helper $func "run"] +proc mi_runto {func args} { + return [mi_runto_helper $func "run" {*}$args] } # Just like runto_main but works with the MI interface. @@ -2683,6 +2696,47 @@ proc mi_make_breakpoint_multi {args} { return $result } +# Construct a breakpoint regexp, for a pending breakpoint. This may +# be used to test the output of -break-insert, -dprintf-insert, or +# -break-info for pending breakpoints. +# +# Arguments for the breakpoint may be specified using the options +# number, type, disp, enabled, pending. +# +# Example: mi_make_breakpoint_pending -number 2 -pending func +# will return the breakpoint: +# bkpt={number="2",type=".*",disp=".*",enabled=".*",addr="", +# pending="func", times="0".*original-location=".*"} + +proc mi_make_breakpoint_pending {args} { + parse_args {{number .*} {type .*} {disp .*} {enabled .*} + {pending .*} {original-location .*}} + + set attr_list {} + foreach attr [list number type disp enabled] { + lappend attr_list $attr [set $attr] + } + + lappend attr_list "addr" "" + + foreach attr [list pending] { + lappend attr_list $attr [set $attr] + } + + set ignore 0 + set times 0 + set script "" + set cond "" + set evaluated-by "" + + set result [mi_make_breakpoint_1 \ + $attr_list $cond ${evaluated-by} $times \ + $ignore $script ${original-location}] + + append result "\\\}" + return $result +} + # Construct a breakpoint regexp. This may be used to test the output of # -break-insert, -dprintf-insert, or -break-info. # -- 2.25.1