Message ID | 62e7b6208a24dea949d901aa1945a87e8683478e.1680293848.git.aburgess@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> 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 0C6C43854153 for <patchwork@sourceware.org>; Fri, 31 Mar 2023 20:21:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0C6C43854153 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1680294091; bh=fB6FX65MCw1gE9d+pANE15RE+D2Jw5QI8r6BUXoDCfM=; 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=xEt1HSkUBpPLWyTaGmz8yzWjJNzRHKk84sshuGNCAbx7XgnxigD9f1qCia04+s+xR N5tT51dMjv9S1RRXmyeGcVO+9259xt3Me7zt8/UAN0rqwa9EZGtb6Mx8RMHH7Tpd5X rvKOwqvn3wpafvSDvV6lz/y4mep7drAfH4TgNPvo= 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.133.124]) by sourceware.org (Postfix) with ESMTPS id E3AF6385843A for <gdb-patches@sourceware.org>; Fri, 31 Mar 2023 20:21:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E3AF6385843A Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-12-MgiY0nraNoqqI4Rv72oRug-1; Fri, 31 Mar 2023 16:21:04 -0400 X-MC-Unique: MgiY0nraNoqqI4Rv72oRug-1 Received: by mail-wm1-f70.google.com with SMTP id i4-20020a05600c354400b003ef649aa8c7so10207351wmq.6 for <gdb-patches@sourceware.org>; Fri, 31 Mar 2023 13:21:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680294063; 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=fB6FX65MCw1gE9d+pANE15RE+D2Jw5QI8r6BUXoDCfM=; b=zhD4P6EzuW2uUXXYCcLV9pvgOoinYsC/W6JYZtWsGX16vezo3mW/CNji2MLSGttZbJ i9BYxzSOKVE+2WgKPJeA7Gp3VfOINu4vSrUR4DpBANQoxbA+bE+Vf5tkZk/7E+3C57cy 37fqHz54kvnt/vC5GKr7zIuI5pSGGJ5gaKqIXQolPXacYuJHE+Ba6xI4jQYgRmHBzvv1 BH2ypwdCjCSSAEa1AMYJMQT+zHIPdJzhddxjHZGzKWFm6kRGqPIbBW/FnHWJKRITp/Yw htsufTaD3lWnMGm8c3MejCwD0bvu4nMtq50L4sd6/qKEJCHtwRhUaUvwEweQiogzFoZS NHMg== X-Gm-Message-State: AAQBX9cpPvD2rrECzoGAfp7szdu2nYLMvGPlyMtGFmwdCYefpG8zrzld Ct+fiSfCtm6v4IbcgS5+nCCKWV1+pC/zhavI6x7Y1AKSqOUBrUHZxVX6HagXp8utGTrUd76An+R kM8gvl4/8Jb3QUKqxj/2YpIruMxNpDfRoqYt8k1m2HKhHKt2Bxx/Fw9YjiGIzRtVd/VqTxPkE/N yEGHjRSg== X-Received: by 2002:adf:d842:0:b0:2ce:a890:7371 with SMTP id k2-20020adfd842000000b002cea8907371mr21322585wrl.12.1680294062865; Fri, 31 Mar 2023 13:21:02 -0700 (PDT) X-Google-Smtp-Source: AKy350aC27TBUJ6l9hO80/404Q5C0NKMaFpWh2v65AjfnfBT47067GPfvdhbVcl9SVi2FwXRjK6SWg== X-Received: by 2002:adf:d842:0:b0:2ce:a890:7371 with SMTP id k2-20020adfd842000000b002cea8907371mr21322573wrl.12.1680294062468; Fri, 31 Mar 2023 13:21:02 -0700 (PDT) Received: from localhost (95.72.115.87.dyn.plus.net. [87.115.72.95]) by smtp.gmail.com with ESMTPSA id h14-20020adffd4e000000b002c71a32394dsm2988116wrs.64.2023.03.31.13.21.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Mar 2023 13:21:02 -0700 (PDT) To: gdb-patches@sourceware.org Cc: Andrew Burgess <aburgess@redhat.com> Subject: [PATCH 1/5] gdb/testsuite: fix occasional failure in gdb.base/clear_non_user_bp.exp Date: Fri, 31 Mar 2023 21:20:54 +0100 Message-Id: <62e7b6208a24dea949d901aa1945a87e8683478e.1680293848.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <cover.1680293848.git.aburgess@redhat.com> References: <cover.1680293848.git.aburgess@redhat.com> 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> From: Andrew Burgess via Gdb-patches <gdb-patches@sourceware.org> Reply-To: Andrew Burgess <aburgess@redhat.com> Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
gdb/testsuite: stricter matching for gdb_test
|
|
Commit Message
Andrew Burgess
March 31, 2023, 8:20 p.m. UTC
I noticed that the gdb.base/clear_non_user_bp.exp test would sometime fail when run from a particular directory. The test tries to find the number of the first internal breakpoint using this proc: proc get_first_maint_bp_num { } { gdb_test_multiple "maint info break" "find first internal bp num" { -re -wrap "(-\[0-9\]).*" { return $expect_out(1,string) } } return "" } The problem is, at the time we issue 'maint info break' there are both internal breakpoint and non-internal (user created) breakpoints in place. The user created breakpoints include the path to the source file. Sometimes, I'll be working from a directory that includes a number, like '/tmp/blah-1/gdb/etc', in which case the pattern above actually matches the '-1' from 'blah-1'. In this case there's no significant problem as it turns out that -1 is the number of the first internal breakpoint. Sometimes my directory name might be '/tmp/blah-4/gdb/etc', in which case the above pattern patches '-4' from 'blah-4'. It turns out this is also not a problem -- the test doesn't actually need the first internal breakpoint number, it just needs the number of any internal breakpoint. But sometimes my directory name might be '/tmp/blah-0/gdb/etc', in which case the pattern above matches '-0' from 'blah-0', and in this case the test fails - there is no internal breakpoint '-0'. Fix this by spotting that the internal breakpoint numbers always occur after a '\r\n', and that they never start with a 0. Our pattern becomes: -re -wrap "\r\n(-\[1-9\]\[0-9\]*).*" { return $expect_out(1,string) } After this I'm no longer seeing any failures. --- gdb/testsuite/gdb.base/clear_non_user_bp.exp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/testsuite/gdb.base/clear_non_user_bp.exp b/gdb/testsuite/gdb.base/clear_non_user_bp.exp index 10e6efddc14..dc1557695bd 100644 --- a/gdb/testsuite/gdb.base/clear_non_user_bp.exp +++ b/gdb/testsuite/gdb.base/clear_non_user_bp.exp @@ -30,7 +30,7 @@ # proc get_first_maint_bp_num { } { gdb_test_multiple "maint info break" "find first internal bp num" { - -re -wrap "(-\[0-9\]).*" { + -re -wrap "\r\n(-\[1-9\]\[0-9\]*).*" { return $expect_out(1,string) } }