From fe1b075f7d999e4cc467727a7e5e7cef52c36935 Mon Sep 17 00:00:00 2001 From: midipix Date: Wed, 18 Sep 2019 02:56:49 +0000 Subject: mgdb: winnt_wait_event(): fetch registers whenever applicable. --- overlay/mgdb/gdb/winnt-nat.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/overlay/mgdb/gdb/winnt-nat.c b/overlay/mgdb/gdb/winnt-nat.c index 5e924dc..21b1e35 100644 --- a/overlay/mgdb/gdb/winnt-nat.c +++ b/overlay/mgdb/gdb/winnt-nat.c @@ -775,6 +775,7 @@ static struct __dbg_event * winnt_wait_event(ptid_t ptid) struct winnt_process * pdbg; struct winnt_process * pcap; struct winnt_process * pidinfo; + struct winnt_thread * thread; struct pollfd pollfdbuf[512]; struct pollfd * pfds; struct pollfd * pfd; @@ -820,6 +821,16 @@ static struct __dbg_event * winnt_wait_event(ptid_t ptid) memcpy(&pidinfo->event,&event,sizeof(event)); + if ((thread = winnt_get_thread(pidinfo,event.systid))) { + __dbg_regs_fetch( + pidinfo->pfd,event.systid, + &thread->regctx); + + winnt_set_thread_context_state( + thread, + WINNT_THREAD_CONTEXT_READY); + } + return &pidinfo->event; } -- cgit v1.2.3