From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id w3OzBh/c+mEaXwAAWB0awg (envelope-from ) for ; Wed, 02 Feb 2022 14:31:43 -0500 Received: by simark.ca (Postfix, from userid 112) id 0A6981F3BA; Wed, 2 Feb 2022 14:31:43 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 3EE861EDEE for ; Wed, 2 Feb 2022 14:31:42 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7A123385842A for ; Wed, 2 Feb 2022 19:31:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7A123385842A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1643830301; bh=hm6WM0ick3PKoGZmmN16Vh/CM8MKiGOnJUvrjOF46i0=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=XAK1w6GLjY30VREipoBJIXURrI8O95QI1xye8u1iBpZd4VBulpNUnGfy7q2LmNe4t 4O18yUmoLLDHu75rlmPXpqZRPLC0tu8JyA/VVq8nQ055chUSNalUlvc+HPURxHRRCF CP6rdB5vncoLOAclg2lzBaV3Y8OZOwCqAzM3BDQs= Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) by sourceware.org (Postfix) with ESMTPS id 2D57F3858D37 for ; Wed, 2 Feb 2022 19:31:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2D57F3858D37 Received: by mail-qk1-x731.google.com with SMTP id b22so546133qkk.12 for ; Wed, 02 Feb 2022 11:31:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hm6WM0ick3PKoGZmmN16Vh/CM8MKiGOnJUvrjOF46i0=; b=kHxfu24T5lzoWpMDjU0yFqV/D8EjvSslUnVDWVx2sOb5yYzjZKpWx95pQUbahYkuCE uzxEDR3rYT9ssHDWL3IprDwwlTZ/pl4kNPYlAjHEv+QyE/Dcgkat99UMuIImwdxnetAP 5QpFwTW+9MGNEgE3jhCwtYwAHIguXN0VP/UXMiS+IV5z5Q1pshWhdd7dQWr2dKkaTcWG bskcFUwT27q1WuwySA2bLEVuqh4KmJKcsA1MNClZvu/eYtgimh6qkYY2qgfTLbwTivd5 sBtHQn4O8H0g2BVGm4GyntLkNh5XaFeBZLWrlXleV/gcDDVObHQSvb4+5yy5CPkKCKpH M+TA== X-Gm-Message-State: AOAM532Wl73ldi6CGAM/iTpEnL+Ys3A2uL2PMYYFFD8kr3ND8XIU8lqX /gK6D+Gz4AJt0GXQmO7j6j5lggseMBui/n3L X-Google-Smtp-Source: ABdhPJz5SDvyMYkVeigzUqqKaS+HNs6+xv8kCbQ2HyflpEPQQO4XIfcASyJBfaG5jL/YAuS90f53sw== X-Received: by 2002:a37:ac08:: with SMTP id e8mr21290482qkm.712.1643830281397; Wed, 02 Feb 2022 11:31:21 -0800 (PST) Received: from localhost.localdomain (bras-base-toroon63x9w-grc-25-174-95-135-52.dsl.bell.ca. [174.95.135.52]) by smtp.gmail.com with ESMTPSA id z22sm5440525qko.2.2022.02.02.11.31.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Feb 2022 11:31:20 -0800 (PST) To: gdb-patches@sourceware.org Subject: [PATCH] gdb: A potential fix for PR-24069 Date: Wed, 2 Feb 2022 14:31:16 -0500 Message-Id: <20220202193116.79655-1-siweihe.eng@gmail.com> X-Mailer: git-send-email 2.32.0 (Apple Git-132) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: , From: "siweihe.eng--- via Gdb-patches" Reply-To: siweihe.eng@gmail.com Cc: Louis-He <1726110778@qq.com> Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" From: Louis-He <1726110778@qq.com> After this fix, the possibility of successful run on mac os increases. However, it is still possible that the gdb hangs. A workaround is issue "control+c" and the gdb will continue running as expected. The root cause of the bug hasn't been identified, and this fix is a temporary patch to PR-24069. --- gdb/darwin-nat.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c index bba6acc7ea1..844dbf499fe 100644 --- a/gdb/darwin-nat.c +++ b/gdb/darwin-nat.c @@ -1104,16 +1104,16 @@ darwin_nat_target::decode_message (mach_msg_header_t *hdr, } if (WIFEXITED (wstatus)) - { - status->set_exited (WEXITSTATUS (wstatus)); - } + { + status->set_exited (WEXITSTATUS (wstatus)); + } else if (WIFSTOPPED (wstatus)) { - status->set_ignore (); + status->set_ignore (); inferior_debug (4, _("darwin_wait: pid %d received WIFSTOPPED\n"), res_pid); return minus_one_ptid; } - else + else { status->set_signalled (gdb_signal_from_host (WTERMSIG (wstatus))); -- 2.32.0 (Apple Git-132)