From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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) From: siweihe.eng@gmail.com To: gdb-patches@sourceware.org Cc: Louis-He <1726110778@qq.com> 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-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Wed, 02 Feb 2022 19:31:24 -0000 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)