From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id WWA4FHrZuGrh7AsAWB0awg (envelope-from ) for ; Sun, 27 Sep 2026 04:53:14 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=jGlXOO9V; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 4A97E1E06B; Sun, 27 Sep 2026 04:53:14 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id C69601E033 for ; Sun, 27 Sep 2026 04:53:13 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 39A304BA79B7 for ; Sun, 27 Sep 2026 08:53:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 39A304BA79B7 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=jGlXOO9V Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id C7A574BA9021 for ; Sun, 27 Sep 2026 08:52:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C7A574BA9021 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C7A574BA9021 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790499169; cv=none; b=D3ZGGDZlQPp/BtbmYyPWmmmstcVqhJJXXxDIXVRhTM5x2ctxp5M2FBWSKrSoLe3gExRvOH/2RGe7OtiX8Aag14e2td+Yeuhdx8xo3FJ0E0pIsE5kPJtWI8G4RAO8cKhAcd26nCSARBnKW2E1D8kV0aakbXcVVAQiA6ovAtHzJqY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790499169; c=relaxed/simple; bh=6erNaxjTlF4IKek9BdELDS2w5WoyJtlUN+QoETV/QYw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ZE9NrDq7IIePMQ4+pg7ShKRpgpTVPI2FFVIuhzVox6D9lfU6McDBWnGeeQ9cQdaqhv1An6MJ03zDbotccOJ9nnFT0T5dum+TeUcHF0z8P6vms5d1LTWE+41dgpiYxQqgddzvjBTEWzvTqb4oxtmq61mPqUY+Zp+Rs1nYe6/Izjw= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=jGlXOO9V DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C7A574BA9021 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1790499169; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=EhuZ339cDJKE+Qltmteo4Vxw4mAsopKqY7DM0f8BfR4=; b=jGlXOO9VnfCK0AfUuRAqkWAs0VfRLrNkschekAyd4AQBdLYXu1YgfSym7KOY0D/EAOXm0J IW2uqoR+Rt4RQYWEUsViqUv0zajbV2vzX+1qfBzd0qL8KbxWCg7EDlWkDtO8V6MW0fXIuh PBzCl7oD33QL2hyHrisR8Kd8pY9HROY= 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_256_GCM_SHA384) id us-mta-438-7RqnWjx4Pt2O2pHK-OWRdA-1; Sun, 27 Sep 2026 04:52:47 -0400 X-MC-Unique: 7RqnWjx4Pt2O2pHK-OWRdA-1 X-Mimecast-MFC-AGG-ID: 7RqnWjx4Pt2O2pHK-OWRdA_1790499166 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-49ff43a1ecbso10449865e9.1 for ; Sun, 27 Sep 2026 01:52:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790499166; x=1791103966; h=content-type:mime-version:message-id:date:references:in-reply-to :subject:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=EhuZ339cDJKE+Qltmteo4Vxw4mAsopKqY7DM0f8BfR4=; b=e+6jbFEV16G07CnMs/xavakBRAPaOcIincAZq8qn944JNMyKQSSxhx5lxA/vrlo8ZA wFDhidsDvPz1RwtN9WbG6lf0sO3zfmuYBe0FpMBdYK30cC3/tViSQPf5EF9lUFwBUt3d /+pgZl58hvjv+c1HA7cF8JR1TEJGMe05f6Gwhe4GqgKZDlgQcKU4fCgS/3TOso+CPyHK 6w05cCH3GCti42o5u2V+Su5bQ5A85vVVMpr4OHm4riIXJMO02Xff92SMF8FIAiHxsJ+Y I0TfgZ7aa61sSgaoyN2mR5TdC3laObGu2LR/DP3U+zxdmIqxXl85ugdS3uChW15EYzvI 0U4A== X-Forwarded-Encrypted: i=1; AKwUvByH5kNlRolxASzzZPaBVHiKRpfZmtp3t7/S14wF/5KlIpmrEdMkEkODp80BsA7Ro0KH/WvtV5el1bFjsg==@sourceware.org X-Gm-Message-State: AFuF++mS8CbG6ZIo6KLL+7cuT6QA/TvzkyFkV00lo9tqdAiAZcW+FZtX 29jZdwk5PfluLFpeq66nbLCvyaBWO+qOiDErTwtj034I6A+qxowbmGDUN5oiMPq52ch4Hm4DQuo MH/JDQxH7+3wIhaNadbKPnmY91P6Bzdrqii5h9gWpjRvDlDi4oyB1I4y+uI0uKz0= X-Gm-Gg: AYBFou3YYtX6K54YCMfm5y+FxgCuDcX3wCm0xOIIUzRnivAYovHEOH6noUziaqu6ad2 0VwiBbyhdJmivJhOw1d3hCyzRr0+j4lG1NNMfTSUfKephW+b3cc+wUugng+RMABptY2i2/dzfha M+Kp5kb8/RLqxjc4m1K21TMRa2mjZ+ndGBIATzunk6yuckHn3TGXp113TJPM/OKADhDT5WUjm+B ZMtRVjCO6prPjCE4r0BGsFjOJ11dqTPI/Ud7dbo0KmL/yGSr+1XdK6iLCZl8HvrFYwUW01MLht4 H+1p4cOA9yrOPcl5CP+h4mC5b1s1LWOMpPc26o4ksYqL01LNCTJ2u/RA6tS+jccZUOAc X-Received: by 2002:a05:600c:6291:b0:49f:ffed:2cb with SMTP id 5b1f17b1804b1-49fffed033bmr30198765e9.6.1790499166447; Sun, 27 Sep 2026 01:52:46 -0700 (PDT) X-Received: by 2002:a05:600c:6291:b0:49f:ffed:2cb with SMTP id 5b1f17b1804b1-49fffed033bmr30198605e9.6.1790499166007; Sun, 27 Sep 2026 01:52:46 -0700 (PDT) Received: from localhost ([213.31.44.29]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4a0017816efsm44136395e9.9.2026.09.27.01.52.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Sep 2026 01:52:45 -0700 (PDT) From: Andrew Burgess To: Tom de Vries , gdb-patches@sourceware.org Subject: Re: [PATCH 1/3] [gdb/testsuite] Add gdb_exit_cleanup In-Reply-To: <20260919084237.1045724-2-tdevries@suse.de> References: <20260919084237.1045724-1-tdevries@suse.de> <20260919084237.1045724-2-tdevries@suse.de> Date: Sun, 27 Sep 2026 09:52:44 +0100 Message-ID: <87mrt313fn.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: wBU2ZKhrn0PLDbMUPRREF9tzpetx-d859zilrQSq9rU_1790499166 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Tom de Vries writes: > Proc default_gdb_exit does two things: > - it tries to make gdb exit, and > - it does cleanup that needs doing after gdb exits. > > Factor out the second part as new proc gdb_exit_cleanup. LGTM. Approved-By: Andrew Burgess Thanks, Andrew > --- > .../gdb.server/monitor-exit-quit.exp | 7 +----- > gdb/testsuite/lib/gdb.exp | 23 ++++++++++++------- > 2 files changed, 16 insertions(+), 14 deletions(-) > > diff --git a/gdb/testsuite/gdb.server/monitor-exit-quit.exp b/gdb/testsuite/gdb.server/monitor-exit-quit.exp > index cb90169ef0c..75c3e6e2221 100644 > --- a/gdb/testsuite/gdb.server/monitor-exit-quit.exp > +++ b/gdb/testsuite/gdb.server/monitor-exit-quit.exp > @@ -70,10 +70,5 @@ gdb_test_multiple "quit" "" { > > # Cleanup, as in default_gdb_exit. > if { $do_cleanup } { > - if { ![is_remote host] } { > - remote_close host > - } > - unset gdb_spawn_id > - unset ::gdb_tty_name > - unset inferior_spawn_id > + gdb_exit_cleanup > } > diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp > index 1ebdaf6ba10..7bdc5dad0a7 100644 > --- a/gdb/testsuite/lib/gdb.exp > +++ b/gdb/testsuite/lib/gdb.exp > @@ -2505,6 +2505,20 @@ proc gdb_reinitialize_dir { subdir } { > } > } > > +# Clean up after the current gdb instance that has exited. > + > +proc gdb_exit_cleanup {} { > + if {![is_remote host]} { > + if {[catch { remote_close host } message]} { > + warning "closing gdb failed with: $message" > + } > + } > + > + unset ::gdb_spawn_id > + unset ::gdb_tty_name > + unset ::inferior_spawn_id > +} > + > # > # gdb_exit -- exit the GDB, killing the target program if necessary > # > @@ -2547,14 +2561,7 @@ proc default_gdb_exit {} { > } > } > > - if {![is_remote host]} { > - if {[catch { remote_close host } message]} { > - warning "closing gdb failed with: $message" > - } > - } > - unset gdb_spawn_id > - unset ::gdb_tty_name > - unset inferior_spawn_id > + gdb_exit_cleanup > } > > # Load a file into the debugger. > -- > 2.51.0