Commit Graph

23 Commits

Author SHA1 Message Date
ed
68fd93f22d Fix missing includes of <string.h>, to silence some compiler warnings.
Submitted by:	Pawel Worach
2009-06-14 12:42:06 +00:00
simokawa
c6862c6dc2 Re-enable raw dump format support on i386 and amd64 for /dev/fwmem. 2007-06-15 11:35:11 +00:00
imp
98103c9fb2 Remove the advertising clause. UCB did this some time ago, but these
files were never updated to reflect that.

MFC After: 2 days
2007-01-08 17:35:36 +00:00
peter
aeeca95e16 Teach libkvm how to read minidumps. It turns out that minidumps are
far more convenient for libkvm to work with because of the page table
block at the beginning.  As a result, the MD code is smaller.

libkvm will automatically detect old vs mini dumps on i386 and amd64.

libkvm will handle i386 PAE and non-PAE modes.  There is a PAE flag in
the i386 minidump header to signal the width of the entries in the
page table block.

Other convenient values are also present, such as kernbase and the direct
map addresses on amd64.
2006-04-21 04:32:51 +00:00
peter
e62b997c41 Fix a well duplicated fencepost error that stopped crashdumps being
readable on certain random memory configurations.  If the libkvm consumer
tried to read something that was in the very last pdpe, pde or pte slot,
it would bogusly fail.

This is broken in RELENG_6 too.
2005-10-20 05:41:38 +00:00
peter
d939998368 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
2005-06-29 22:39:41 +00:00
peter
506da60972 Implement crashdump decoding for AMD64 as well, now that I have finally
got a sample to test against.
2004-05-19 18:24:13 +00:00
peter
968cbdb047 AMD64 support; repocopied from i386 2003-04-30 21:05:33 +00:00
bde
229c3ac7c3 Compensate for "Compensate for header dethreading" by backing it out. 2001-10-10 17:48:44 +00:00
dillon
41abc6d4e4 Implement __FBSDID() 2001-09-16 21:35:07 +00:00
peter
89bd0a4338 Dynamically adjust to the value of KERNBASE in a crashdump, with
a fallback for old kernels without the "kernbase" symbol.
2001-08-24 08:53:30 +00:00
markm
ddbd7bc718 Compensate for header dethreading. 2001-05-01 09:24:15 +00:00
peter
047fa82dd0 Use kldsym(2) to lookup symbol values. This avoids the kvm_mkdb juggling
and is module aware.  Yes, this means that kvm_nlist(3) will find symbols
in loaded modules.  The emulation of the nlist struct is pretty crude but
seems to work well enough for all the users in the tree that I found.
1999-12-27 07:14:58 +00:00
tegge
3dbac0faf6 Copy code from gnu/usr.bin/gdb/gdb/kvm-fbsd.c to deal with 4 MB pages. 1997-08-17 17:42:59 +00:00
peter
2ed8e17b91 Implement virtual-to-physical address mapping for the kvm library on
dead kernel debugging.  The previous code was a "do nothing".

The most obvious side effect of this is that you can now do things like
this and reasonably expect them to work:
  dmesg -M /var/crash/vmcore.3 -N /var/crash/kernel.3
  ps -axl -M /var/crash/vmcore.3 -N /var/crash/kernel.3

A good deal of this was lifted from the gdb code to do this, as well as
from NetBSD's libkvm (which has completely different VM macros)
1996-10-07 20:17:50 +00:00
jkh
c4d4a99d31 General -Wall warning cleanup, part I.
Submitted-By: Kent Vander Velden <graphix@iastate.edu>
1996-07-12 18:57:58 +00:00
phk
e4ee69bc24 NBPG -> PAGE_SIZE 1996-05-02 09:23:36 +00:00
rgrimes
f05428e4cd Remove trailing whitespace. 1995-05-30 05:51:47 +00:00
phk
e91914fc35 A semicolon was lost. 1994-11-07 19:54:55 +00:00
jkh
233f442355 From: "gj%pcs.dec.com@inet-gw-1.pa.dec.com" <garyj@rks32.pcs.dec.com>
Given the right circumstances, a call to kvm_open can result in a core
dump.

The diff belows fixes this (note that this change is already in the
NetBSD code). Could somebody apply this?

Gary J.
Submitted by:	gj
1994-11-07 09:42:24 +00:00
dg
89be8c23d3 Made kvm routines use procfs to get out process data such as argument
strings.
1994-08-11 13:38:23 +00:00
rgrimes
01c9385475 Fix kvm_i386.c just enough to make it compile and return lots of errors
when called.  Noop out swapread in kvm_proc.c as our vm system is
different.
1994-05-28 05:48:30 +00:00
rgrimes
0095655af3 This is a COPY of kvm_hp300.c, soon to be patched to sorta work with
the i386 port.
1994-05-28 04:34:59 +00:00