Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2085900
  • 博文数量: 414
  • 博客积分: 10312
  • 博客等级: 上将
  • 技术积分: 4921
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-31 01:49
文章分类

全部博文(414)

文章存档

2011年(1)

2010年(29)

2009年(82)

2008年(301)

2007年(1)

分类: C/C++

2009-06-08 12:26:59

 


adb can be used to analyze a core file to determine the cause of a panic. Note that Solaris versions to 7 require that adb be run on a system with the same system type and OS as the machine that produced the core dump. Solaris 8+ allows adb to run on a different system type.

The following procedure is useful for diagnosing system crashes due to traps:

To invoke adb on a core file, type: adb -k unix.n vmcore.n.

$< msgbuf prints out the message buffer. Of particular interest are the error messages, g7 (the current thread address), rp (the register pointer), pc (the program counter address), and sp (the stack pointer).

(Note: We can also find this information by using strings vmcore.n | more.)

Alternatively we can find rp by using $c to display the stack and picking up the second argument to trap or die. We can then find pc by executing rp_address$< regs.

The instructions in the program counter can be displayed with pc_address/40ai. (A truncated version can be displayed with pc_address/ai.)

g7 can also be obtained by looking at the panic_thread variable with panic_thread/X for 32-bit or panic_thread/K for 64-bit systems.

In order to look at the command that caused the panic, we need to find procp by running g7_address$< thread. The command will be located in the psargs field of the output from procp_address$< proc2u. The remainder of the output from this command represents the user structure of the process.

阅读(1262) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~