trgt_i386.c (173681) | trgt_i386.c (175771) |
---|---|
1/* 2 * Copyright (c) 2004 Marcel Moolenaar 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * --- 11 unchanged lines hidden (view full) --- 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 2004 Marcel Moolenaar 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * --- 11 unchanged lines hidden (view full) --- 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/gnu/usr.bin/gdb/kgdb/trgt_i386.c 173681 2007-11-16 22:17:37Z jhb $"); | 28__FBSDID("$FreeBSD: head/gnu/usr.bin/gdb/kgdb/trgt_i386.c 175771 2008-01-28 20:33:19Z jhb $"); |
29 30#include <sys/param.h> 31#include <sys/proc.h> 32#include <machine/pcb.h> 33#include <machine/frame.h> 34#include <machine/segments.h> 35#include <machine/tss.h> 36#include <err.h> --- 99 unchanged lines hidden (view full) --- 136 * data. On older kernels, the CPU0's private page 137 * is stored at an address that isn't mapped in minidumps. 138 * However, the data is mapped at the alternate cpu0prvpage 139 * address. Thus, if the TSS is at the invalid address, 140 * change it to be relative to cpu0prvpage instead. 141 */ 142 if (trunc_page(tss) == 0xffc00000) { 143 addr = kgdb_lookup("_cpu0prvpage"); | 29 30#include <sys/param.h> 31#include <sys/proc.h> 32#include <machine/pcb.h> 33#include <machine/frame.h> 34#include <machine/segments.h> 35#include <machine/tss.h> 36#include <err.h> --- 99 unchanged lines hidden (view full) --- 136 * data. On older kernels, the CPU0's private page 137 * is stored at an address that isn't mapped in minidumps. 138 * However, the data is mapped at the alternate cpu0prvpage 139 * address. Thus, if the TSS is at the invalid address, 140 * change it to be relative to cpu0prvpage instead. 141 */ 142 if (trunc_page(tss) == 0xffc00000) { 143 addr = kgdb_lookup("_cpu0prvpage"); |
144 if (addr == 0) | 144 if (addr == 0) { 145 warnx("kvm_nlist(_cpu0prvpage): %s", kvm_geterr(kvm)); |
145 return (0); | 146 return (0); |
147 } |
|
146 if (kvm_read(kvm, addr, &cpu0prvpage, sizeof(cpu0prvpage)) != 147 sizeof(cpu0prvpage)) { 148 warnx("kvm_read: %s", kvm_geterr(kvm)); 149 return (0); 150 } 151 tss = cpu0prvpage + (tss & PAGE_MASK); 152 } 153 return ((CORE_ADDR)tss); --- 200 unchanged lines hidden --- | 148 if (kvm_read(kvm, addr, &cpu0prvpage, sizeof(cpu0prvpage)) != 149 sizeof(cpu0prvpage)) { 150 warnx("kvm_read: %s", kvm_geterr(kvm)); 151 return (0); 152 } 153 tss = cpu0prvpage + (tss & PAGE_MASK); 154 } 155 return ((CORE_ADDR)tss); --- 200 unchanged lines hidden --- |