From 2390f50b84f70ada9259624e9b5341dd563ecfec Mon Sep 17 00:00:00 2001 From: "David E. O'Brien" Date: Thu, 6 Jul 2000 22:08:50 +0000 Subject: MFC: rev 1.22 (debugging support when using libc_r's pthreads) --- gnu/usr.bin/binutils/gdb/i386/freebsd-nat.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) (limited to 'gnu') diff --git a/gnu/usr.bin/binutils/gdb/i386/freebsd-nat.c b/gnu/usr.bin/binutils/gdb/i386/freebsd-nat.c index 84c121d8e50f..8dd81d16d1b6 100644 --- a/gnu/usr.bin/binutils/gdb/i386/freebsd-nat.c +++ b/gnu/usr.bin/binutils/gdb/i386/freebsd-nat.c @@ -1,3 +1,4 @@ +/* $FreeBSD$ */ /* Native-dependent code for BSD Unix running on i386's, for GDB. Copyright 1988, 1989, 1991, 1992, 1994, 1996 Free Software Foundation, Inc. @@ -345,20 +346,9 @@ i386_float_info () uaddr = (char *)&U_FPSTATE(u) - (char *)&u; if (inferior_pid != 0 && core_bfd == NULL) { - int *ip; - - rounded_addr = uaddr & -sizeof (int); - rounded_size = (((uaddr + sizeof (struct fpstate)) - uaddr) + - sizeof (int) - 1) / sizeof (int); - skip = uaddr - rounded_addr; - - ip = (int *)buf; - for (i = 0; i < rounded_size; i++) - { - *ip++ = ptrace (PT_READ_U, inferior_pid, (caddr_t)rounded_addr, 0); - rounded_addr += sizeof (int); - } - fpstatep = (struct fpstate *)(buf + skip); + int pid = inferior_pid & ((1 << 17) - 1); /* XXX extract pid from tid */ + ptrace(PT_GETFPREGS, pid, &buf[0], sizeof(struct fpreg)); + fpstatep = (struct fpstate *)&buf[0]; } else fpstatep = &pcb_savefpu; -- cgit v1.3