From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by sourceware.org (Postfix) with ESMTPS id 779B43858034 for ; Mon, 15 Mar 2021 23:43:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 779B43858034 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=alves.ped@gmail.com Received: by mail-wm1-f42.google.com with SMTP id y124-20020a1c32820000b029010c93864955so383745wmy.5 for ; Mon, 15 Mar 2021 16:43:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0geXNdk2g5FpRtHlbSu+h89eaBzZjc3/HuUGGvG5yEo=; b=DP4UcrNCmCq179JODRu4LW/m7lHEyRcg/iEpZsKUg8T897lQKHl1D2iFIuWckik/q5 zOHXCkOu1dQx9TPIMhOwoGLXHkXJzKOiQLcS4eOA+IM1Q2zEU3Y7NMW1/gW6zSuRpZIK sXFsnY9jWEcXQXRHLZj4/MbigBBKxmtuUPx2Ge5E9n2es3V6dot4uO0H0tyObYXIga75 68isX1SurHqrJ/ZXHGXUs1c3F6jp6ij7Ams9o+d8CMOsN0JhLxu/9sKa3oaDU8ljy4nv xSUPHW/6u48i0jZGeBAzRZ17Db4g9Uq3yn8+pJA53J5KORpRji91KD5KdYhhhS7R7f39 ba4w== X-Gm-Message-State: AOAM5339w83+y/yR7W1P1uk6opVi6//ayuTGTB4+5bE0+oqVn3xaXtz+ tDaW+eJw/KPpw7+xypF+NwZJwA8kFVfryA== X-Google-Smtp-Source: ABdhPJwfeJXRdULKSt5eJy+MEkrAT/P3SNpqVj9CFp4EA5hv/kM12vTtK1/8L0CWB7IojsTwSDBzhg== X-Received: by 2002:a1c:600a:: with SMTP id u10mr1859179wmb.139.1615851824893; Mon, 15 Mar 2021 16:43:44 -0700 (PDT) Received: from localhost ([2001:8a0:f916:a600:6ce4:78d2:da9d:3dae]) by smtp.gmail.com with ESMTPSA id p27sm1199467wmi.12.2021.03.15.16.43.43 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 15 Mar 2021 16:43:44 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 2/3] Fix bkpt-other-inferior.exp race Date: Mon, 15 Mar 2021 23:43:38 +0000 Message-Id: <20210315234339.457551-3-pedro@palves.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210315234339.457551-1-pedro@palves.net> References: <20210315234339.457551-1-pedro@palves.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Mon, 15 Mar 2021 23:43:47 -0000 gdb.server/bkpt-other-inferior.exp sometimes fails like so: (gdb) inferior 2 [Switching to inferior 2 [process 368191] ()] [Switching to thread 2.1 (Thread 368191.368191)] [remote] Sending packet: $m7ffff7fd0100,1#5b [remote] Packet received: 48 [remote] Sending packet: $m7ffff7fd0100,1#5b [remote] Packet received: 48 [remote] Sending packet: $m7ffff7fd0100,9#63 [remote] Packet received: 4889e7e8e80c000049 #0 0x00007ffff7fd0100 in ?? () (gdb) PASS: gdb.server/bkpt-other-inferior.exp: inf 2: switch to inferior break -q main Breakpoint 2 at 0x1138: file /home/pedro/gdb/binutils-gdb/src/gdb/testsuite/gdb.server/server.c, line 21. (gdb) PASS: gdb.server/bkpt-other-inferior.exp: inf 2: set breakpoint delete breakpoints Delete all breakpoints? (y or n) y (gdb) [remote] wait: enter [remote] wait: exit FAIL: gdb.server/bkpt-other-inferior.exp: inf 2: delete all breakpoints in delete_breakpoints (timeout) ERROR: breakpoints not deleted Remote debugging from host ::1, port 55876 monitor exit The problem is here: (gdb) [remote] wait: enter The testcase isn't expecting any output after the prompt. This fixes it by removing the anchor. Change-Id: I2fd152fd9c46b1c5e7fa678cc4d4054dac0b2bd4 --- gdb/testsuite/gdb.server/bkpt-other-inferior.exp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/gdb/testsuite/gdb.server/bkpt-other-inferior.exp b/gdb/testsuite/gdb.server/bkpt-other-inferior.exp index 8992f190d21..df7af35fbb7 100644 --- a/gdb/testsuite/gdb.server/bkpt-other-inferior.exp +++ b/gdb/testsuite/gdb.server/bkpt-other-inferior.exp @@ -71,23 +71,25 @@ gdb_test_multiple "file" $test { # breakpoint on inferior 1, since it has symbols, and should not # result in any access to inferior 2's remote target. -gdb_test_no_output "set debug remote 1" - foreach inf_sel {1 2} { with_test_prefix "inf $inf_sel" { gdb_test "inferior $inf_sel" "Switching to inferior $inf_sel.*" \ "switch to inferior" + gdb_test_no_output "set debug remote 1" + set test "set breakpoint" gdb_test_multiple "break -q main" $test { - -re "Sending packet.*$gdb_prompt $" { + -re "Sending packet.*$gdb_prompt " { fail $test } - -re "^break -q main\r\nBreakpoint .* at .*$gdb_prompt $" { + -re "^break -q main\r\nBreakpoint .* at .*$gdb_prompt " { pass $test } } + gdb_test_no_output "set debug remote 0" + delete_breakpoints } } -- 2.26.2