diff --git a/gnu/usr.bin/binutils/gdb/i386/freebsd-nat.c b/gnu/usr.bin/binutils/gdb/i386/freebsd-nat.c index b2c0eea49880..15c9c087578a 100644 --- a/gnu/usr.bin/binutils/gdb/i386/freebsd-nat.c +++ b/gnu/usr.bin/binutils/gdb/i386/freebsd-nat.c @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: freebsd-nat.c,v 1.7 1995/05/30 04:57:05 rgrimes Exp $ + $Id: freebsd-nat.c,v 1.8 1996/05/02 09:42:45 phk Exp $ */ #include @@ -526,7 +526,7 @@ CORE_ADDR addr; /* * Read the first-level page table (ptd). */ - v = current_ptd + ((unsigned)addr >> PD_SHIFT) * sizeof pte; + v = current_ptd + ((unsigned)addr >> PDRSHIFT) * sizeof pte; if (physrd(fd, v, (char *)&pte, sizeof pte) < 0 || (pte&PG_V) == 0) return (~0); @@ -537,7 +537,7 @@ CORE_ADDR addr; if (physrd(fd, v, (char *) &pte, sizeof(pte)) < 0 || (pte&PG_V) == 0) return (~0); - addr = (pte & PG_FRAME) + (addr & PGOFSET); + addr = (pte & PG_FRAME) + (addr & PAGE_MASK); #if 0 printf("vtophys(%x) -> %x\n", oldaddr, addr); #endif @@ -605,7 +605,7 @@ kernel_core_file_hook(fd, addr, buf, len) break; } /* we can't read across a page boundary */ - i = min(len, PAGE_SIZE - (addr & PGOFSET)); + i = min(len, PAGE_SIZE - (addr & PAGE_MASK)); if ((cc = physrd(fd, paddr, cp, i)) <= 0) { bzero(cp, len); return (cp - buf); diff --git a/gnu/usr.bin/gdb/gdb/freebsd-nat.c b/gnu/usr.bin/gdb/gdb/freebsd-nat.c index b2c0eea49880..15c9c087578a 100644 --- a/gnu/usr.bin/gdb/gdb/freebsd-nat.c +++ b/gnu/usr.bin/gdb/gdb/freebsd-nat.c @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: freebsd-nat.c,v 1.7 1995/05/30 04:57:05 rgrimes Exp $ + $Id: freebsd-nat.c,v 1.8 1996/05/02 09:42:45 phk Exp $ */ #include @@ -526,7 +526,7 @@ CORE_ADDR addr; /* * Read the first-level page table (ptd). */ - v = current_ptd + ((unsigned)addr >> PD_SHIFT) * sizeof pte; + v = current_ptd + ((unsigned)addr >> PDRSHIFT) * sizeof pte; if (physrd(fd, v, (char *)&pte, sizeof pte) < 0 || (pte&PG_V) == 0) return (~0); @@ -537,7 +537,7 @@ CORE_ADDR addr; if (physrd(fd, v, (char *) &pte, sizeof(pte)) < 0 || (pte&PG_V) == 0) return (~0); - addr = (pte & PG_FRAME) + (addr & PGOFSET); + addr = (pte & PG_FRAME) + (addr & PAGE_MASK); #if 0 printf("vtophys(%x) -> %x\n", oldaddr, addr); #endif @@ -605,7 +605,7 @@ kernel_core_file_hook(fd, addr, buf, len) break; } /* we can't read across a page boundary */ - i = min(len, PAGE_SIZE - (addr & PGOFSET)); + i = min(len, PAGE_SIZE - (addr & PAGE_MASK)); if ((cc = physrd(fd, paddr, cp, i)) <= 0) { bzero(cp, len); return (cp - buf);