From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by sourceware.org (Postfix) with ESMTPS id B78263858D33 for ; Wed, 22 Feb 2023 15:19:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B78263858D33 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f45.google.com with SMTP id v3so8033333wrp.2 for ; Wed, 22 Feb 2023 07:19:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kYrG/0vahF9TyRPwDBG0jJHwhyndCIN7gnSHquGyI2U=; b=ITxF6+IY+HDgNhGOqgVwLUbbMctrVWaWPuiyd53ImzeTVHh5xB+XhZws6bdqBrivMs q5vDsxN4q9DBUcLT8zTJ6sUHqBV8x62Hnlo8BnsuFFMNrDQpMqV3FBKmyi910AFPL7W9 r70mGM7C4Qztgbdch2wW76sV/Ob205+G1Dwo1gm5RQsnNW+nP+NTadi+1c+Kfjwoz2X7 4GVIpcq3u0a8Ho/izmGtBUPQKkXaW0L53CEpvSXKV3AOBJytrahJlVBLg1TVV0Eehn11 o1sk0Uh25ELdg4qDe10OHgj74gMIi1CF23eE0Yj40HY3t0Je43KbcRGfiIVJFcyWSwcQ 16Vw== X-Gm-Message-State: AO0yUKWk2XuwGn0o3E2n+ss9PbAYWORbv2inJ3MsYH1JlIerZCjZtiLL i+4e4nK2C0/MwWpXiWaX8BNdPKrx5ax8FQ== X-Google-Smtp-Source: AK7set8kU2TVz+TP/BbKqf4bwwzTvGxSgRj2FCkGOzWXg8yhH9ZXMB40K7SzILfi8TSrZ2LdZEZKgw== X-Received: by 2002:a05:6000:188b:b0:2c5:4e06:b689 with SMTP id a11-20020a056000188b00b002c54e06b689mr8396499wri.28.1677079184191; Wed, 22 Feb 2023 07:19:44 -0800 (PST) Received: from ?IPv6:2001:8a0:f92b:9e00::1fe? ([2001:8a0:f92b:9e00::1fe]) by smtp.gmail.com with ESMTPSA id w6-20020adff9c6000000b002c5493a17efsm4533639wrr.25.2023.02.22.07.19.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Feb 2023 07:19:43 -0800 (PST) Subject: Re: [PATCH 7/8] gdb/testsuite: fix failure in gdb.mi/mi-pending.exp with extended-remote To: Andrew Burgess , gdb-patches@sourceware.org References: From: Pedro Alves Message-ID: Date: Wed, 22 Feb 2023 15:19:43 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,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: On 2023-02-20 2:13 p.m., Andrew Burgess via Gdb-patches wrote: > 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 ""}} Intro comment needs update. Otherwise: Approved-By: Pedro Alves Pedro Alves > > 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 \ >