From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2064.outbound.protection.outlook.com [40.107.223.64]) by sourceware.org (Postfix) with ESMTPS id 76B20386C598 for ; Fri, 17 Jun 2022 10:10:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 76B20386C598 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SpJ6DYjo8vZEe4GS1bCTMQaI94vwVaeSBvmYx7aEPdf4tyMTnWOiWG2rskdE5UV+a8mBVMWjTaUhZrVaTyy5RnBlA2ukF+/5blwcM9plywJJ9mP9AHHnrgk0lMEWaikrnRzS2VRgRviw+G3fyaMXuP82G/6s+XcNtZGcrRnJSU3N7axgtEiSYVLAN4KGLtrjWwSayNjjynGqLlpIq+9LkGEIyI40EqqYFoHVKLkee9mp1LPO0YT2wYfhSK90LaolDjq17/aRMECtUNBl0+2hMMQhZnxBR4+BG1hJdgsPgXWBvR7f/CYL6Bm+y9fdbaquf7Cy9U4wrp7TyOUovSDq7A== 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=wmmgXkZ0N072wexHEhX+PjiDCGnMnEVu5yMDYIhqWAw=; b=R8df/xdZV+pkmFivpDvjA5+ZXpY+eCOXKQepe5jGXky7hoPxcG4j+jNbBhhNjqtIOJM4/xTBgGDnp/FMsHPZ5uO1QFshgG7EJy2U6UmHbkuGMREOOPhmyL+9+SrQju5Zt2MokHboAR7D+bSh5Tzaaq+ZVXECv9JgmW5Xaiq5Gam3Dlgi51rRHLen4CZdFDFFQUn3m49wKyd7UYhJaqqi5i5Ymwlj48egqNngYInHqyP4B7dwpauqwfqD4hJmDLQO9lVPSaTrkUYVGSFfXEN+C08WfKqLZqgwXKgDpNcr+dSHI7vdolrd37p9z5V9hMo8EmAcylS5mM8lUUO05DBgyg== 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 MW4PR02CA0001.namprd02.prod.outlook.com (2603:10b6:303:16d::21) by BY5PR12MB4052.namprd12.prod.outlook.com (2603:10b6:a03:209::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.14; Fri, 17 Jun 2022 10:10:48 +0000 Received: from CO1NAM11FT039.eop-nam11.prod.protection.outlook.com (2603:10b6:303:16d:cafe::38) by MW4PR02CA0001.outlook.office365.com (2603:10b6:303:16d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.23 via Frontend Transport; Fri, 17 Jun 2022 10:10:48 +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 CO1NAM11FT039.mail.protection.outlook.com (10.13.174.110) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5353.14 via Frontend Transport; Fri, 17 Jun 2022 10:10:48 +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; Fri, 17 Jun 2022 05:10:46 -0500 From: Lancelot SIX To: CC: , Pedro Alves Subject: [PATCH 1/3] MI: mi_runto -pending Date: Fri, 17 Jun 2022 11:10:22 +0100 Message-ID: <20220617101024.2830260-2-lancelot.six@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220617101024.2830260-1-lancelot.six@amd.com> References: <20220617101024.2830260-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: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 32749891-a182-4123-73cf-08da5049a6b7 X-MS-TrafficTypeDiagnostic: BY5PR12MB4052: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: fXgSS37Xcpx2ry79yds2+SVJD8uII2G97r7x7xMZ/C4KZIvPupsgenljZUHWppnRMJAbDHSJ3rEEBi0HuuBbp5yf9/VNedJKsuxQ1xiO6nd6vn6RSz5/VvGYzWPGm1P+RU6xqAAk1/0IzMqn/uEWCr5/gor+Lv2W3mdgSNYSfBUr2RlMQzMHeJ9rLI4b6hdLecyIhvn5m/xNK1fUmvBgGRbVsBneWtefXtUX76GsgEecVoQ1p3/11oXalW67QBGQQmUd/fcvwGnrmB2rsIxqOATCF35r5xc7tzPFdQ4HJiRY/HOf8+3frgdyNTv41HcXRsFpkn8f7V0FEGq6agthhXzyaippRkVYUddPFNAg54zxwVDvembUz7R31nQNut6W8iALo3O7zQmysOqZNi2mZe4180PnL63HJCpOH+irWC3tr6XMerEOqBA9EMhgnMoMJ0f6+sNCJyHTxaJPUvI0b3vVZOzqiHuf0/xfB0d95YlLFtVHrDKMxBn6wqyQ5/WPyxCkXBVf+5PAtmHQBUCJqJurZ1+r3l+rI2eT9UatGbw9iu2o9rXH/TT3BW7ApaaGDYpszhsl4yWYU69Tv+25OyKsg1G7XTSVTA+IkePSRmQUkQB9UZPtfLBgsDOFbhOKITB3TUBE0yCHsnngr8J86daONmxvJt13YpM9nkvpG719hDLPYs/xLwvcCvGOYny6p8Ny6yp8Eo01wDyxaHsNBg== 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)(46966006)(40470700004)(36840700001)(16526019)(1076003)(186003)(336012)(47076005)(81166007)(7696005)(426003)(6666004)(26005)(2616005)(36860700001)(86362001)(83380400001)(356005)(8936002)(4326008)(8676002)(82310400005)(36756003)(2906002)(5660300002)(40460700003)(54906003)(316002)(70586007)(70206006)(508600001)(6916009)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2022 10:10:48.4503 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 32749891-a182-4123-73cf-08da5049a6b7 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: CO1NAM11FT039.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4052 X-Spam-Status: No, score=-11.8 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: Fri, 17 Jun 2022 10:10:58 -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 | 66 +++++++++++++++++++++++++++++--- 1 file changed, 60 insertions(+), 6 deletions(-) diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp index e578a7e6f9b..e724b2eeb51 100644 --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -1114,6 +1114,8 @@ 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 @@ -1122,13 +1124,24 @@ proc mi_runto_helper {func run_or_continue args} { parse_args {{qualified}} 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