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.133.124]) by sourceware.org (Postfix) with ESMTPS id E3AF6385843A for ; Fri, 31 Mar 2023 20:21:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E3AF6385843A 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=1680294065; 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=fB6FX65MCw1gE9d+pANE15RE+D2Jw5QI8r6BUXoDCfM=; b=Z0/Il7Fb9ABYnqc55WWDmI8AyOSh0PjhdXI3NWPKOkpdOyxep+uQDY/PLzJH7jm0KNNbtZ 6hhf2/OeYnVWBslaTgbwKDIVf2i5mbETtLolUETJqe+lVVaeHaG7oFw8V56jSox78tjfpB c5gzqTATFqK3lO6yQaFWW00xWfDeeFo= 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 ; 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) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess 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: 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 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) } } -- 2.25.4