diff options
Diffstat (limited to 'src/libmach/Linux.c')
-rw-r--r-- | src/libmach/Linux.c | 95 |
1 files changed, 0 insertions, 95 deletions
diff --git a/src/libmach/Linux.c b/src/libmach/Linux.c index 893ef6b4..530150d8 100644 --- a/src/libmach/Linux.c +++ b/src/libmach/Linux.c @@ -447,98 +447,3 @@ proctextfile(int pid) return nil; } -int -sys_ps_lgetregs(struct ps_prochandle *ph, uint tid, void *regs) -{ - int i, oldpid; - uint u, *uregs; - - oldpid = corpid; - ptraceattach(tid); - uregs = (uint*)regs; - for(i=0; i<sizeof(UregLinux386)/sizeof(uint); i++){ - errno = 0; - u = ptrace(PTRACE_PEEKUSER, tid, 4*i, 0); - if(errno) - return 1; - uregs[i] = u; - } - ptraceattach(oldpid); - return 0; -} - -int -sys_ps_lsetregs(struct ps_prochandle *ph, uint tid, void *regs) -{ - return 1; -} - -int -sys_ps_lgetfpregs(struct ps_prochandle *ph, uint tid, void *regs) -{ - return 1; -} - - -int -sys_ps_lsetfpregs(struct ps_prochandle *ph, uint tid, void *regs) -{ - return 1; -} - - - - -#if 0 - snprint(buf, sizeof buf, "/proc/%d/maps", pid); - if((b = Bopen(buf, OREAD)) == nil){ - werrstr("open %s: %r", buf); - return -1; - } - -/* - 08048000-08056000 r-xp 00000000 03:0c 64593 /usr/sbin/gpm - 08056000-08058000 rw-p 0000d000 03:0c 64593 /usr/sbin/gpm - 08058000-0805b000 rwxp 00000000 00:00 0 - 40000000-40013000 r-xp 00000000 03:0c 4165 /lib/ld-2.2.4.so - 40013000-40015000 rw-p 00012000 03:0c 4165 /lib/ld-2.2.4.so - 4001f000-40135000 r-xp 00000000 03:0c 45494 /lib/libc-2.2.4.so - 40135000-4013e000 rw-p 00115000 03:0c 45494 /lib/libc-2.2.4.so - 4013e000-40142000 rw-p 00000000 00:00 0 - bffff000-c0000000 rwxp 00000000 00:00 0 -*/ - - file = nil; - while((p = Brdline(b, '\n')) != nil){ - p[Blinelen(b)-1] = 0; - memset(f, 0, sizeof f); - if((nf = getfields(p, f, 6, 1, " ")) < 5) - continue; - base = strtoul(f[0], &p, 16); - if(*p != '-') - continue; - end = strtoul(p+1, &p, 16); - if(*p != 0) - continue; - offset = strtoul(f[2], &p, 16); - if(*p != 0) - continue; - if(nf == 6) - file = f[5]; - zero = atoi(f[4]) == 0; - print("%lux-%lux %lux %s %s\n", base, end, offset, zero ? "data" : "text", file ? file : ""); - s.base = base; - s.size = end - base; - s.offset = offset; - s.name = zero ? "data" : "text"; - s.file = strdup(file); - s.rw = ptracerw; - s.pid = pid; - if(addseg(map, s) < 0){ - Bterm(b); - ptrace(PTRACE_DETACH, pid, 0, 0); - return -1; - } - } - Bterm(b); -#endif |