Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Hannes Domani <ssbssa@yahoo.de>
To: gdb-patches@sourceware.org
Subject: [PATCH 1/2] gdb+gdbserver: Fix build for aarch64-windows
Date: Tue, 23 Jun 2026 18:29:17 +0200	[thread overview]
Message-ID: <20260623162918.3155215-1-ssbssa@yahoo.de> (raw)
In-Reply-To: <20260623162918.3155215-1-ssbssa.ref@yahoo.de>

Some time ago siginfo_re was made per-thread state, but
not every use location was adjusted, giving this error:

../../gdb/aarch64-windows-nat.c:139:31: error: no member named 'siginfo_er' in 'aarch64_windows_per_inferior'
  139 |   if (aarch64_windows_process.siginfo_er.ExceptionCode != EXCEPTION_BREAKPOINT
      |       ~~~~~~~~~~~~~~~~~~~~~~~ ^

Fix by looking up the exception-record of the current thread.
---
 gdb/aarch64-windows-nat.c      | 13 +++++++++----
 gdbserver/win32-aarch64-low.cc | 13 +++++++++----
 2 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/gdb/aarch64-windows-nat.c b/gdb/aarch64-windows-nat.c
index 29a6c95d485..b0d5f66884b 100644
--- a/gdb/aarch64-windows-nat.c
+++ b/gdb/aarch64-windows-nat.c
@@ -136,12 +136,17 @@ const int aarch64_mappings[] =
 std::vector<CORE_ADDR>
 aarch64_windows_nat_target::stopped_data_addresses ()
 {
-  if (aarch64_windows_process.siginfo_er.ExceptionCode != EXCEPTION_BREAKPOINT
-      || aarch64_windows_process.siginfo_er.NumberParameters != 2)
+  windows_thread_info *th = aarch64_windows_process.find_thread (inferior_ptid);
+  if (th == nullptr
+      || th->last_event.dwDebugEventCode != EXCEPTION_DEBUG_EVENT)
     return {};
 
-  const CORE_ADDR addr_trap
-    = (CORE_ADDR) aarch64_windows_process.siginfo_er.ExceptionInformation[1];
+  EXCEPTION_RECORD &er = th->last_event.u.Exception.ExceptionRecord;
+  if (er.ExceptionCode != EXCEPTION_BREAKPOINT
+      || er.NumberParameters != 2)
+    return {};
+
+  const CORE_ADDR addr_trap = (CORE_ADDR) er.ExceptionInformation[1];
 
   struct aarch64_debug_reg_state *state
     = aarch64_get_debug_reg_state (inferior_ptid.pid ());
diff --git a/gdbserver/win32-aarch64-low.cc b/gdbserver/win32-aarch64-low.cc
index 17f64906df4..5a7b72155db 100644
--- a/gdbserver/win32-aarch64-low.cc
+++ b/gdbserver/win32-aarch64-low.cc
@@ -133,12 +133,17 @@ aarch64_remove_point (enum raw_bkpt_type type, CORE_ADDR addr,
 static std::vector<CORE_ADDR>
 aarch64_stopped_data_addresses ()
 {
-  if (windows_process.siginfo_er.ExceptionCode != EXCEPTION_BREAKPOINT ||
-      windows_process.siginfo_er.NumberParameters != 2)
+  windows_thread_info *th = windows_process.find_thread (current_thread->id);
+  if (th == nullptr
+      || th->last_event.dwDebugEventCode != EXCEPTION_DEBUG_EVENT)
     return {};
 
-  const CORE_ADDR addr_trap
-    = (CORE_ADDR) windows_process.siginfo_er.ExceptionInformation[1];
+  EXCEPTION_RECORD &er = th->last_event.u.Exception.ExceptionRecord;
+  if (er.ExceptionCode != EXCEPTION_BREAKPOINT ||
+      er.NumberParameters != 2)
+    return {};
+
+  const CORE_ADDR addr_trap = (CORE_ADDR) er.ExceptionInformation[1];
 
   return aarch64_stopped_data_addresses (&debug_reg_state, addr_trap);
 }
-- 
2.54.0


       reply	other threads:[~2026-06-23 16:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260623162918.3155215-1-ssbssa.ref@yahoo.de>
2026-06-23 16:29 ` Hannes Domani [this message]
2026-06-23 16:29   ` [PATCH 2/2] gdb: " Hannes Domani
2026-06-26 14:37     ` Tom Tromey
2026-06-26 15:03       ` Hannes Domani
2026-06-26 14:37   ` [PATCH 1/2] gdb+gdbserver: " Tom Tromey

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=20260623162918.3155215-1-ssbssa@yahoo.de \
    --to=ssbssa@yahoo.de \
    --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