Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@adacore.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@adacore.com>
Subject: [PATCH] Two logging fixes to win32-low.cc
Date: Tue,  1 Sep 2026 13:24:55 -0600	[thread overview]
Message-ID: <20260901192455.3344494-1-tromey@adacore.com> (raw)

While debugging the Windows gdbserver, I found a couple of minor
problems in some logging statements in win32-low.cc.

First, one spot could call target_waitstatus::sig for the wrong kind
of object, resulting in an assertion failure.

Second, the "unknown" logging case can be made a bit nicer by printing
a string rather than an integer.
---
 gdbserver/win32-low.cc | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/gdbserver/win32-low.cc b/gdbserver/win32-low.cc
index 7629beca213..13c14a7c69f 100644
--- a/gdbserver/win32-low.cc
+++ b/gdbserver/win32-low.cc
@@ -1168,8 +1168,11 @@ win32_process_target::wait (ptid_t ptid, target_waitstatus *ourstatus,
 	case TARGET_WAITKIND_SIGNALLED:
 	case TARGET_WAITKIND_LOADED:
 	  {
-	    OUTMSG2 (("Child Stopped with signal = %d \n",
-		      ourstatus->sig ()));
+	    if (ourstatus->kind () == TARGET_WAITKIND_LOADED)
+	      OUTMSG2 (("Child stopped due to library load\n"));
+	    else
+	      OUTMSG2 (("Child stopped with signal = %d \n",
+			ourstatus->sig ()));
 	    maybe_adjust_pc (current_event);
 
 	    /* All-stop, suspend all threads until they are explicitly
@@ -1179,8 +1182,8 @@ win32_process_target::wait (ptid_t ptid, target_waitstatus *ourstatus,
 	    return debug_event_ptid (&current_event);
 	  }
 	default:
-	  OUTMSG (("Ignoring unknown internal event, %d\n",
-		  ourstatus->kind ()));
+	  OUTMSG (("Ignoring unknown internal event, %s\n",
+		   ourstatus->to_string ().c_str ()));
 	  [[fallthrough]];
 	case TARGET_WAITKIND_SPURIOUS:
 	  /* do nothing, just continue */

base-commit: 6f24afa4391bd33f1263378280b99385d2c13055
-- 
2.55.0


             reply	other threads:[~2026-09-01 19:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-01 19:24 Tom Tromey [this message]
2026-09-01 19:34 ` Andrew Burgess

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=20260901192455.3344494-1-tromey@adacore.com \
    --to=tromey@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /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