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 0FE653841811 for ; Mon, 20 Feb 2023 14:14:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0FE653841811 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=1676902447; 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=4qWM+Apb6VFpgy/d8YvKTgNNDa4JOllsdlAM6fBk1X8=; b=gYXkRuPq60v1lv7l2uPsPv7+AWUovN8S6SA1EVrPl6Ipi86rt0O0upseGTJwCR+gGwC8rq uSCcNfvGiT1IG5YOR0zU107dJCemS4J8QZrIUQRnWYZWPEVumRYhYbQO+dB5yYANEFqUeP Sbf1kW2/nSj2Zo3RbW4K+norp0Vm5v4= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-445-jYr7CKf8OieZArCmtguynQ-1; Mon, 20 Feb 2023 09:14:06 -0500 X-MC-Unique: jYr7CKf8OieZArCmtguynQ-1 Received: by mail-wm1-f71.google.com with SMTP id j7-20020a05600c1c0700b003dc5dd44c0cso591616wms.8 for ; Mon, 20 Feb 2023 06:14:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=4qWM+Apb6VFpgy/d8YvKTgNNDa4JOllsdlAM6fBk1X8=; b=JWb2loK0gEeqs/OvAORd0OV8xsdtoqStXsdx1PyX3yQEhOAbmECwHtCq1ujpl7s5/p ZX3U3IyWaBarRrGMiLXvDoCLA7ZTHZKGmsOP2JUPfQNeMByHSeIDsNqy8VuGL43oNPgP HvYGc3rFPKrRrRVNA5n/bQjYFtSnSLXU59A60i5bigHnqTv9L2+3rqtA9tu9Tdmhmxkh 4mEPXLiXEAOVTPEOa9xpEWf2pqJGo024A7/a4joFGg6xpZlJcdKHiVT93EgI4VE98JI2 BpikRZDsHSZy1/gkFM33tfvUIORtmP8KsLv1UAV6kFaYRg+yEST4fx/03npz/1J3kzRN Ih6g== X-Gm-Message-State: AO0yUKW1e1ezaSkhjBDqaJWMEIrMTM3wu313PrvtkrBS37G313xaGI8s pwm1qwH/QqwEy5vTfIswoTyCmFRU2wn3zaPQmzlouv2YULTxP16NeQ5s24rnzmAW8eKidjobJOL bgPyC2wXYAXMlr9VZ2cZFWw/RuqGMf++jqp5WDecWqBdBOFLHiRPLqx4SG3AQHY31og7XbZVVuJ vFF8w= X-Received: by 2002:a05:600c:54ee:b0:3dc:4356:533c with SMTP id jb14-20020a05600c54ee00b003dc4356533cmr752019wmb.5.1676902445182; Mon, 20 Feb 2023 06:14:05 -0800 (PST) X-Google-Smtp-Source: AK7set8nNUz7IGXUsnZMlVVntseimARirHtWdwtEPwGw+5bvpZjCOcIa/OE1mKGq2cbrQpwEoJBXlA== X-Received: by 2002:a05:600c:54ee:b0:3dc:4356:533c with SMTP id jb14-20020a05600c54ee00b003dc4356533cmr752005wmb.5.1676902444880; Mon, 20 Feb 2023 06:14:04 -0800 (PST) Received: from localhost (95.72.115.87.dyn.plus.net. [87.115.72.95]) by smtp.gmail.com with ESMTPSA id x9-20020a05600c21c900b003e11ad0750csm14455614wmj.47.2023.02.20.06.14.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Feb 2023 06:14:04 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 7/8] gdb/testsuite: fix failure in gdb.mi/mi-pending.exp with extended-remote Date: Mon, 20 Feb 2023 14:13:52 +0000 Message-Id: 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: I currently see this failure when running the gdb.mi/mi-pending.exp test using the native-extended-remote board: -break-insert -f -c x==4 mi-pendshr.c:pendfunc2 &"No source file named mi-pendshr.c.\n" ^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="",pending="mi-pendshr.c:pendfunc2",cond="x==4",evaluated-by="host",times="0",original-location="mi-pendshr.c:pendfunc2"} (gdb) FAIL: gdb.mi/mi-pending.exp: MI pending breakpoint on mi-pendshr.c:pendfunc2 if x==4 (unexpected output) The failure is caused by the 'evaluated-by="host"' string, which only appears in the output when the test is run using the native-extended-remote board. I could fix this by just updating the pattern in gdb.mi/mi-pending.exp, but I have instead updated mi-pending.exp to make more use of the support procs in mi-support.exp. This did require making a couple of adjustments to mi-support.exp, but I think the result is that mi-pending.exp is now easier to read, and I see no failures with native-extended-remote anymore. One of the test names has changed after this work, I think the old test name was wrong - it described a breakpoint as pending when the breakpoint was not pending, I suspect a copy & paste error. But there's no changes to what is actually being tested after this patch. --- gdb/testsuite/gdb.mi/mi-pending.exp | 34 +++++++++++++++++++++-------- gdb/testsuite/lib/mi-support.exp | 11 ++++++++-- 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/gdb/testsuite/gdb.mi/mi-pending.exp b/gdb/testsuite/gdb.mi/mi-pending.exp index a5c6ee5c906..71c3d45fe44 100644 --- a/gdb/testsuite/gdb.mi/mi-pending.exp +++ b/gdb/testsuite/gdb.mi/mi-pending.exp @@ -52,19 +52,35 @@ mi_load_shlibs $lib_sl1 mi_load_shlibs $lib_sl2 # Set pending breakpoint via MI. -mi_gdb_test "-break-insert -f pendfunc1" \ - ".*\\^done,bkpt=\{number=\"1\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"\",pending=\"pendfunc1\",times=\"0\",original-location=\"pendfunc1\"\}"\ - "MI pending breakpoint on pendfunc1" +mi_create_breakpoint_pending "-f pendfunc1" \ + "MI pending breakpoint on pendfunc1" \ + -number "1" \ + -type "breakpoint" \ + -disp "keep" \ + -enabled "y" \ + -pending "pendfunc1" \ + -original-location "pendfunc1" # Set pending breakpoint with a condition via MI. -mi_gdb_test "-break-insert -f -c x==4 ${libfile1}.c:pendfunc2" \ - ".*\\^done,bkpt=\{number=\"2\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"\",pending=\"${libfile1}.c:pendfunc2\",cond=\"x==4\",times=\"0\",original-location=\"${libfile1}.c:pendfunc2\"\}"\ - "MI pending breakpoint on ${libfile1}.c:pendfunc2 if x==4" +mi_create_breakpoint_pending "-f -c x==4 ${libfile1}.c:pendfunc2" \ + "MI pending breakpoint on ${libfile1}.c:pendfunc2 if x==4" \ + -number "2" \ + -type "breakpoint" \ + -disp "keep" \ + -enabled "y" \ + -pending "${libfile1}.c:pendfunc2" \ + -cond "x==4" \ + -original-location "${libfile1}.c:pendfunc2" # Set breakpoint so that we can stop when the thread is created -mi_gdb_test "-break-insert -f thread_func" \ - ".*\\^done,bkpt=\{number=\"3\",type=\"breakpoint\",disp=\"keep\",enabled=\"y\",addr=\"${hex}\",func=\"thread_func\".*\}"\ - "MI pending breakpoint on thread_func" +mi_create_breakpoint "-f thread_func" \ + "MI breakpoint on thread_func" \ + -number "3" \ + -type "breakpoint" \ + -disp "keep" \ + -enabled "y" \ + -addr "$hex" \ + -func "thread_func" mi_run_cmd diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp index 2ab751749e9..c072da08a04 100644 --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -1390,6 +1390,14 @@ proc mi_create_breakpoint_multi {location test args} { return $bp } +# Like mi_create_breakpoint, but creates a pending breakpoint. + +proc mi_create_breakpoint_pending {location test args} { + set bp [eval mi_make_breakpoint_pending $args] + mi_gdb_test "222-break-insert $location" ".*\r\n222\\^done,$bp" $test + return $bp +} + # Creates varobj named NAME for EXPRESSION. # Name cannot be "-". proc mi_create_varobj { name expression testname } { @@ -2639,7 +2647,7 @@ proc mi_make_breakpoint_multi {args} { proc mi_make_breakpoint_pending {args} { parse_args {{number .*} {type .*} {disp .*} {enabled .*} - {pending .*} {original-location .*} {thread ""}} + {pending .*} {original-location .*} {thread ""} {cond ""}} set attr_list {} foreach attr [list number type disp enabled] { @@ -2655,7 +2663,6 @@ proc mi_make_breakpoint_pending {args} { set ignore 0 set times 0 set script "" - set cond "" set evaluated-by "" set result [mi_make_breakpoint_1 \ -- 2.25.4