WEB开发网
开发学院操作系统Linux/Unix AIX 下的 core dump 分析入门 阅读

AIX 下的 core dump 分析入门

 2008-11-10 08:27:41 来源:WEB开发网   
核心提示: 如果没有使用 -g 编译,则不能动态获取 g_test 的类型、大小等信息,AIX 下的 core dump 分析入门(9),但能够得到 g_test 的地址,并查询该地址所在区域存储空间的值

如果没有使用 -g 编译,则不能动态获取 g_test 的类型、大小等信息,但能够得到 g_test 的地址,并查询该地址所在区域存储空间的值。

例如:

# ./a.out
IOT/Abort trap(coredump)
# dbx ./a.out core
Type 'help' for help.
[using memory image in core]
reading symbolic information ...
IOT/Abort trap in raise at 0xd03365bc
0xd03365bc (raise+0x40) 80410014 lwz r2,0x14(r1)
(dbx) print g_test
1
(dbx) whatis g_test
int g_test;
(dbx) print sizeof(g_test)
4
(dbx) print &g_test
0x20000428
(dbx) &g_test/16x
0x20000428: 0000 0001 0000 0000 0000 0000 0000 0000
0x20000438: 0000 0000 0000 0000 0000 0000 0000 0000

列举寄存器内容

列举寄存器内容:

(dbx) registers

如下模拟一个简单的 core dump,对 0 地址赋值引发 core dump 的问题:

# dbx ./a.out core
Type 'help' for help.
warning: The core file is not a fullcore. Some info may
not be available.
[using memory image in core]
reading symbolic information ...warning: no source compiled with -g
Segmentation fault in main at 0x10000348
0x10000348 (main+0x18) 90640000 stw r3,0x0(r4)
(dbx) where
main(0x1, 0x2ff22ccc) at 0x10000348
(dbx) registers
$r0:0x00000000 $stkp:0x2ff22bf0 $toc:0x20000414 $r3:0x00000012
$r4:0x00000000 $r5:0x2ff22cd4 $r6:0xdeadbeef $r7:0x2ff22ff8
$r8:0x00000000 $r9:0x04030000 $r10:0xf0577538 $r11:0xdeadbeef
$r12:0xdeadbeef $r13:0xdeadbeef $r14:0x00000001 $r15:0x2ff22ccc
$r16:0x2ff22cd4 $r17:0x00000000 $r18:0xdeadbeef $r19:0xdeadbeef
$r20:0xdeadbeef $r21:0xdeadbeef $r22:0xdeadbeef $r23:0xdeadbeef
$r24:0xdeadbeef $r25:0xdeadbeef $r26:0xdeadbeef $r27:0xdeadbeef
$r28:0xdeadbeef $r29:0xdeadbeef $r30:0xdeadbeef $r31:0xdeadbeef
$iar:0x10000348 $msr:0x0000d0b2 $cr:0x22282489 $link:0x100001b4
$ctr:0xdeadbeef $xer:0x20000020
Condition status = 0:e 1:e 2:e 3:l 4:e 5:g 6:l 7:lo
[unset $noflregs to view floating point registers]
[unset $novregs to view vector registers]
in main at 0x10000348
0x10000348 (main+0x18) 90640000 stw r3,0x0(r4)
(dbx) print $r3
0x00000012
(dbx) print $r4
(nil)

上一页  4 5 6 7 8 9 10  下一页

Tags:AIX core dump

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接