summaryrefslogtreecommitdiff
path: root/overlay/mgdb/gdb/amd64-winnt-regcache.c
diff options
context:
space:
mode:
Diffstat (limited to 'overlay/mgdb/gdb/amd64-winnt-regcache.c')
-rw-r--r--overlay/mgdb/gdb/amd64-winnt-regcache.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/overlay/mgdb/gdb/amd64-winnt-regcache.c b/overlay/mgdb/gdb/amd64-winnt-regcache.c
index 83a836c..7a1dab6 100644
--- a/overlay/mgdb/gdb/amd64-winnt-regcache.c
+++ b/overlay/mgdb/gdb/amd64-winnt-regcache.c
@@ -8,6 +8,7 @@
#include "osabi.h"
#include "regcache.h"
#include "amd64-tdep.h"
+#include "winnt-nat.h"
#include <signal.h>
#include <sys/debug.h>
@@ -61,23 +62,29 @@ static void amd64_winnt_supply_core_regs(
amd64_winnt_supply_reg(rcache,AMD64_EFLAGS_REGNUM,regctx->uc_eflags);
}
-int amd64_winnt_fetch_registers(
- int pfd, struct regcache * rcache,
- int regnum, pid_t tid)
+void amd64_winnt_fetch_registers(
+ struct regcache * rcache, int regnum,
+ struct winnt_thread * thread)
{
- int ret;
- mcontext_t regctx;
+ int pfd;
+ pid_t tid;
+ mcontext_t * regctx;
- if ((ret = __dbg_regs_fetch(pfd,tid,&regctx)) < 0)
- return ret;
+ pfd = thread->process->pfd;
+ tid = thread->tid;
+ regctx = &thread->regctx;
+
+ if (thread->regctx.uc_context_flags)
+ if (__dbg_regs_fetch(pfd,tid,regctx) < 0)
+ return;
if (regnum == AMD64_RIP_REGNUM) {
- amd64_winnt_supply_pc_regs(rcache,&regctx);
+ amd64_winnt_supply_pc_regs(rcache,regctx);
} else {
- amd64_winnt_supply_core_regs(rcache,&regctx);
+ amd64_winnt_supply_core_regs(rcache,regctx);
}
- return 0;
+ regctx->uc_context_flags = WINNT_THREAD_CONTEXT_READY;
}
#define AMD64_WINNT_INIT_REG_OFFSET(regnum,regmem) \