summaryrefslogtreecommitdiff
path: root/overlay/mgdb/gdb/winnt-nat.c
diff options
context:
space:
mode:
Diffstat (limited to 'overlay/mgdb/gdb/winnt-nat.c')
-rw-r--r--overlay/mgdb/gdb/winnt-nat.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/overlay/mgdb/gdb/winnt-nat.c b/overlay/mgdb/gdb/winnt-nat.c
index d32464c..449b740 100644
--- a/overlay/mgdb/gdb/winnt-nat.c
+++ b/overlay/mgdb/gdb/winnt-nat.c
@@ -30,6 +30,8 @@
#define winnt_perror(msg,pid) \
error("%s(): %s (pid %d).",__FUNCTION__,msg,pid)
+struct regcache;
+
struct winnt_process {
int pfd;
pid_t pid;
@@ -42,6 +44,14 @@ static size_t pcnt;
static winnt_process * plist;
static char * outbuf;
+extern void amd64_winnt_fetch_registers(
+ int pfd, struct regcache * rcache,
+ int regnum, pid_t tid);
+
+extern void i386_winnt_fetch_registers(
+ int pfd, struct regcache * rcache,
+ int regnum, pid_t tid);
+
static winnt_process * winnt_plist_expand (void)
{
struct winnt_process * pnew;
@@ -122,9 +132,26 @@ static void winnt_fetch_registers (
struct regcache * rcache,
int regnum)
{
- (void)t;
- (void)rcache;
- (void)regnum;
+ pid_t pid;
+ pid_t tid;
+ struct winnt_process * pidinfo;
+
+ pid = inferior_ptid.pid;
+ tid = inferior_ptid.tid;
+
+ if (!(pidinfo = winnt_process_record(pid)))
+ winnt_perror("internal error: record not found",pid);
+
+ if (sizeof(uintptr_t) == 8)
+ amd64_winnt_fetch_registers(
+ pidinfo->pfd,
+ rcache,regnum,
+ tid);
+ else
+ i386_winnt_fetch_registers(
+ pidinfo->pfd,
+ rcache,regnum,
+ tid);
}
static void winnt_store_registers (