Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "siweihe.eng--- via Gdb-patches" <gdb-patches@sourceware.org>
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	[thread overview]
Message-ID: <20220202193116.79655-1-siweihe.eng@gmail.com> (raw)

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)


             reply	other threads:[~2022-02-02 19:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-02 19:31 siweihe.eng--- via Gdb-patches [this message]
2022-02-02 20:57 ` Simon Marchi
2022-02-02 21:01   ` Siwei He via Gdb-patches
2022-02-02 21:26     ` Simon Marchi
2022-02-03 18:04       ` Siwei He via Gdb-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220202193116.79655-1-siweihe.eng@gmail.com \
    --to=gdb-patches@sourceware.org \
    --cc=1726110778@qq.com \
    --cc=siweihe.eng@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox