免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3382 | 回复: 0
打印 上一主题 下一主题

[故障求助] KDB kernel debugger and kdb command问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-11-21 15:12 |只看该作者 |倒序浏览
AIX信息中心KDB的配置,If you are using the Hardware Management Console, KDB kernel debugger can be accessed using a virtual terminal. For more information, see the Hardware Management Console Installation and Operations Guide (SA38 - 0590).的意思是不是必须要有HMC?
KDB kernel debugger and kdb command
Invoking the KDB kernel debugger
This topic describes how to load and start the KDB kernel debugger, and what you need to know about terminal use. For information on how to invoke the kdb command, see Invoking the kdb command.
Loading and starting the KDB kernel debugger in AIX 5.1 and subsequent releases
For AIX 5.1 and subsequent releases, the KDB kernel debugger is the standard kernel debugger and is included in the unix_up and unix_mp kernels, which are in the /usr/lib/boot file.
The KDB kernel debugger must be loaded at boot time. This requires that a boot image be created with the debugger enabled. To enable the KDB kernel debugger, use either the -I or -D options of the bosboot command.
Examples of bosboot commands are as follows:
·
To disable the KDB kernel debugger, use the following command:
bosboot -a -d /dev/ipldevice
·
To enable the KDB kernel debugger, but not invoke it during system initialization, use the following command:
bosboot -a -d /dev/ipldevice -D
·
To enable the KDB kernel debugger, and invoke it during system initialization, use the following command:
bosboot -a -d /dev/ipldevice -I
Notes:
1.
bosboot commands build boot images using the KDB kernel debugger. The boot image is not used until the machine is restarted.
2.
External interrupts are disabled while the KDB kernel debugger is active.
3.
If invoked during system initialization, the g subcommand must be issued to continue the initialization process.
For more information on the bosboot command, see AIX 5L Version 5.3 Commands Reference, Volume 1
Loading and starting the KDB kernel debugger in AIX 4.3.3
The KDB kernel debugger must be loaded at boot time. This requires that a boot image be created with the debugger enabled. To enable the KDB kernel debugger, the bosboot command must be invoked with a KDB kernel specified and options set to enable the KDB kernel debugger. KDB kernels are shipped as /usr/lib/boot/unix_kdb for uni-processor (UP) systems and /usr/lib/boot/unix_mp_kdb for Multi-processor (MP) systems. The specific kernel used to create the boot image can be specified using the -k option of the bosboot command. The KDB kernel debugger must also be enabled using either the -I or -D options of the bosboot command.
Examples of bosboot commands for a UP system are as follows:
·
To disable the KDB kernel debugger, use the following command:
bosboot -a -d /dev/ipldevice -k /usr/lib/boot/unix_kdb
·
To enable the KDB kernel debugger, but not invoke it during system initialization, use the following command:
bosboot -a -d /dev/ipldevice -D -k /usr/lib/boot/unix_kdb
·
To enable the KDB kernel debugger, and invoke it during system initialization, use the following command:
bosboot -a -d /dev/ipldevice -I -k /usr/lib/boot/unix_kdb
Notes:
1.
For an MP system, the /usr/lib/boot/unix_mp_kdb file is used instead of the /usr/lib/boot/unix_kdb file.
2.
The bosboot commands build boot images using the KDB kernel debugger. The boot image is not used until the machine is restarted.
3.
External interrupts are disabled while the KDB kernel debugger is active.
4.
If invoked during system initialization, the g subcommand must be issued to continue the initialization process.
For more information about the bosboot command, see AIX 5L Version 5.3 Commands Reference, Volume 1
The /usr/lib/boot/unix and /unix links are not changed by the bosboot command. However, these links are used by user commands such as sar and others to read symbol information for the kernel. If these commands are to be used with a KDB boot image /unix and /usr/lib/boot/unix must point to the kernel specified for the bosboot command. This can be done by removing and recreating the links. This must be done as the root user. For the previous bosboot command examples, typing the following would set up the links correctly:
1.
Type
rm /unix
and press Enter.
2.
Type
ln -s /usr/lib/boot/unix_kdb /unix
and press Enter.
3.
Type
rm /usr/lib/boot/unix
and press Enter.
4.
Type
ln -s /usr/lib/boot/unix_kdb /usr/lib/boot/unix
and press Enter.
Similarly, if you chose to stop using a KDB Kernel, the links for /unix and /usr/lib/boot/unix should be modified to point to the kernel specified to the bosboot command.
Note:
/unix is the default kernel used by the bosboot command. If this link is changed to point to a KDB kernel, after bosboot commands that do not have a kernel specified are run, the commands use the KDB kernel.
Entering the KDB kernel debugger
Enter the KDB kernel debugger using one of the following procedures:
·
On a tty keyboard, press the Ctrl+4 key sequence for IBM(R) 3151 terminals or the Ctrl+\ key sequence for BQ 303, BQ 310C, and WYSE 50 terminals.
·
On other keyboards, press the Ctrl+Alt+Numpad4 key sequence.
·
Set a breakpoint using one of the Breakpoint and steps subcommands.
·
Call the brkpoint subroutine from the C code. The syntax for calling this subroutine is the following:

brkpoint();
Note:
The system enters the debugger if a system halt is caused by a fatal system error. In such a case, the system creates a log entry in the system log and if the KDB kernel debugger is available, it is called. A system dump might be generated when you exit from the debugger.
If the kernel debug program is not available when you type in a key sequence, you must load the kernel debug program.
You can use the kdb command with the dw subcommand to determine whether the KDB kernel debugger is available by typing the following:

# kdb

(0)> dw kdb_avail

(0)> dw kdb_wanted
Note:
If either of the previous dw subcommands returns a 0, the KDB kernel debugger is not available.
After the KDB kernel debugger is invoked, the subcommands detailed in Subcommand lists are available.
Using a terminal with the KDB kernel debugger
Note:
If you are using the Hardware Management Console, KDB kernel debugger can be accessed using a virtual terminal. For more information, see the Hardware Management Console Installation and Operations Guide (SA38 - 0590).
The KDB kernel debugger opens an asynchronous ASCII terminal when it is first started, and subsequently upon being started due to a system halt. Native serial ports are checked sequentially, starting with port 0 (zero). Each port is configured at 9600 bps, 8 bits, and no parity. If carrier detect is asserted within 1/10 of a second, the port is used. Otherwise, the next available native port is checked. This process continues until a port is opened or until every native port available on the machine is checked. If no native serial port is opened successfully, the result is unpredictable.
The KDB kernel debugger only supports display to an ASCII terminal connected to a native serial port. Displays connected to graphics adapters are not supported. The KDB kernel debugger uses its own device driver for handling the display terminal. It is possible to connect a serial line between two machines and define the serial line port as the port for the console. In that case, the cu command can be used to connect to the target machine and run the KDB kernel debugger.
Note:
If a serial device, other than a terminal connected to a native serial port, is selected by the kernel debugger, the system might appear to hang.
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP