summaryrefslogtreecommitdiffstats
path: root/lib/libkvm/kvm.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2005-06-29 22:39:41 +0000
committerpeter <peter@FreeBSD.org>2005-06-29 22:39:41 +0000
commitd93999836826da90a255a4a59fa2f6fe8f289425 (patch)
tree39d1193a271289253e98780ca48579504e690508 /lib/libkvm/kvm.c
parent49bfde6bf0b6c2db289cd0ec08415985788c17e0 (diff)
downloadFreeBSD-src-d93999836826da90a255a4a59fa2f6fe8f289425.zip
FreeBSD-src-d93999836826da90a255a4a59fa2f6fe8f289425.tar.gz
Support crash dumps > 4GB in size on 32 bit platforms. _kvm_kvatop()
returned an lseek offset in a "u_long *" value, which can't express >4GB offsets on 32 bit machines (eg: PAE). Change to "off_t *" for all. Support ELF crashdumps on i386 and amd64. Support PAE crashdumps on i386. This is done by auto-detecting the presence of the IdlePDPT which means that PAE is active. I used Marcel's _kvm_pa2off strategy and ELF header reader for ELF support on amd64. Paul Saab ported the amd64 changes to i386 and we implemented the PAE support from there. Note that gdb6 in the src tree uses whatever libkvm supports. If you want to debug an old crash dump, you might want to keep an old libkvm.so handy and use LD_PRELOAD or the like. This does not detect the old raw dump format. Approved by: re
Diffstat (limited to 'lib/libkvm/kvm.c')
-rw-r--r--lib/libkvm/kvm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libkvm/kvm.c b/lib/libkvm/kvm.c
index 44a9e8c..9e97a78 100644
--- a/lib/libkvm/kvm.c
+++ b/lib/libkvm/kvm.c
@@ -369,7 +369,7 @@ kvm_read(kd, kva, buf, len)
} else {
cp = buf;
while (len > 0) {
- u_long pa;
+ off_t pa;
cc = _kvm_kvatop(kd, kva, &pa);
if (cc == 0)
@@ -377,7 +377,7 @@ kvm_read(kd, kva, buf, len)
if (cc > len)
cc = len;
errno = 0;
- if (lseek(kd->pmfd, (off_t)pa, 0) == -1 && errno != 0) {
+ if (lseek(kd->pmfd, pa, 0) == -1 && errno != 0) {
_kvm_syserr(kd, 0, _PATH_MEM);
break;
}
OpenPOWER on IntegriCloud