aboutsummaryrefslogtreecommitdiff
path: root/gdbserver/win32-low.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gdbserver/win32-low.cc')
-rw-r--r--gdbserver/win32-low.cc42
1 files changed, 4 insertions, 38 deletions
diff --git a/gdbserver/win32-low.cc b/gdbserver/win32-low.cc
index 985c6a0..4707acc 100644
--- a/gdbserver/win32-low.cc
+++ b/gdbserver/win32-low.cc
@@ -1308,45 +1308,11 @@ win32_process_target::qxfer_siginfo (const char *annex,
windows_thread_info *th
= windows_process.find_thread (current_thread_ptid ());
- if (th->last_event.dwDebugEventCode != EXCEPTION_DEBUG_EVENT)
- return -1;
-
- if (readbuf == nullptr)
- return -1;
-
- EXCEPTION_RECORD &er = th->last_event.u.Exception.ExceptionRecord;
-
- char *buf = (char *) &er;
- size_t bufsize = sizeof (er);
-
-#ifdef __x86_64__
- EXCEPTION_RECORD32 er32;
- if (windows_process.wow64_process)
- {
- buf = (char *) &er32;
- bufsize = sizeof (er32);
-
- er32.ExceptionCode = er.ExceptionCode;
- er32.ExceptionFlags = er.ExceptionFlags;
- er32.ExceptionRecord
- = (uintptr_t) er.ExceptionRecord;
- er32.ExceptionAddress
- = (uintptr_t) er.ExceptionAddress;
- er32.NumberParameters = er.NumberParameters;
- for (int i = 0; i < EXCEPTION_MAXIMUM_PARAMETERS; i++)
- er32.ExceptionInformation[i] = er.ExceptionInformation[i];
- }
-#endif
-
- if (offset > bufsize)
+ ULONGEST xfered_len;
+ if (th->xfer_siginfo (readbuf, offset, len, &xfered_len))
+ return xfered_len;
+ else
return -1;
-
- if (offset + len > bufsize)
- len = bufsize - offset;
-
- memcpy (readbuf, buf + offset, len);
-
- return len;
}
bool