打印本文 打印本文 关闭窗口 关闭窗口
Linux kernel release 2.0.xx
作者:武汉SEO闵涛  文章来源:敏韬网  点击数3988  更新时间:2009/4/22 20:45:36  文章录入:mintao  责任编辑:mintao
   me or anybody else very much: it will depend on your particular
   kernel setup.  What you should do is take the hex value from the EIP
   line (ignore the "0010:"), and look it up in the kernel namelist to
   see which kernel function contains the offending address.
 
   To find out the kernel function name, you''''ll need to find the system
   binary associated with the kernel that exhibited the symptom.  This is
   the file ''''linux/vmlinux''''.  To extract the namelist and match it against
   the EIP from the kernel crash, do:
 
            nm vmlinux | sort | less
 
   This will give you a list of kernel addresses sorted in ascending
   order, from which it is simple to find the function that contains the
   offending address.  Note that the address given by the kernel
   debugging messages will not necessarily match exactly with the
   function addresses (in fact, that is very unlikely), so you can''''t
   just ''''grep'''' the list: the list will, however, give you the starting
   point of each kernel function, so by looking for the function that
   has a starting address lower than the one you are searching for but
   is followed by a function with a higher address you will find the one
   you want.  In fact, it may be a good idea to include a bit of
   "context" in your problem report, giving a few lines around the
   interesting one. 
 
   If you for some reason cannot do the above (you have a pre-compiled
   kernel image or similar), telling me as much about your setup as
   possible will help. 
 
 - alternately, you can use gdb on a running kernel. (read-only; i.e. you
   cannot change values or set break points.) To do this, first compile the
   kernel with -g; edit arch/i386/Makefile appropriately, then do a "make
   clean". You''''ll also need to enable CONFIG_PROC_FS (via "make config").
 
   After you''''ve rebooted with the new kernel, do "gdb vmlinux /proc/kcore".
   You can now use all the usual gdb commands. The command to look up the
   point where your system crashed is "l *0xXXXXXXXX". (Replace the XXXes
   with the EIP value.)
 
   gdb''''ing a non-running kernel currently fails because gdb (wrongly)
   disregards the starting offset for which the kernel is compiled.

上一页  [1] [2] [3] [4] [5] [6] 

打印本文 打印本文 关闭窗口 关闭窗口