Chinaunix
标题:
gdb vmlinux(no debugging symbols found)
[打印本页]
作者:
luoyan_xy
时间:
2011-10-27 10:58
标题:
gdb vmlinux(no debugging symbols found)
我在编译内核的时候已经选中了 CONFIG_DEBUG_INFO 以及 CONFIG_DEBUG_KERNEL选项
可是通过gdb调试的时候却出现以下提示
gdb /usr/src/linux/vmlinux
Reading symbols from /usr/src/linux-2.6.38.8/vmlinux...(no debugging symbols found)...done.
一直没弄明白是怎么回事,导致在后面调试内核vmcore时不能成功,哪位能给些建议吗?
作者:
wayling
时间:
2011-10-27 12:13
同鞋试试这个吧 readelf --debug-dump vmlinux 看看是不是真的有debug symble
没的话表示你的config有问题
作者:
tempname2
时间:
2011-10-27 15:24
debug symbol?是行号之类的信息么,objdump -h看一下有没有带debug字样的段。
作者:
luoyan_xy
时间:
2011-10-28 09:06
回复
3#
tempname2
34 .debug_aranges 000186e0 0000000000000000 0000000000000000 00e2b010 2**4
CONTENTS, READONLY, DEBUGGING
35 .debug_pubnames 00044fd7 0000000000000000 0000000000000000 00e436f0 2**0
CONTENTS, READONLY, DEBUGGING
36 .debug_info 03bcb2ae 0000000000000000 0000000000000000 00e886c7 2**0
CONTENTS, READONLY, DEBUGGING
37 .debug_abbrev 0017ea6a 0000000000000000 0000000000000000 04a53975 2**0
CONTENTS, READONLY, DEBUGGING
38 .debug_line 00355cb5 0000000000000000 0000000000000000 04bd23df 2**0
CONTENTS, READONLY, DEBUGGING
39 .debug_frame 000d3530 0000000000000000 0000000000000000 04f28098 2**3
CONTENTS, READONLY, DEBUGGING
40 .debug_str 0015efc7 0000000000000000 0000000000000000 04ffb5c8 2**0
CONTENTS, READONLY, DEBUGGING
41 .debug_loc 00700b05 0000000000000000 0000000000000000 0515a58f 2**0
CONTENTS, READONLY, DEBUGGING
42 .debug_ranges 0015a840 0000000000000000 0000000000000000 0585b094 2**0
CONTENTS, READONLY, DEBUGGING
复制代码
objdump -h vmlinux 后能够看到这些信息
作者:
luoyan_xy
时间:
2011-10-28 09:07
回复
2#
wayling
<2><e8970>: Abbrev Number: 30 (DW_TAG_member)
DW_AT_name : (indirect string, offset: 0x111ab6): i_rdev
DW_AT_decl_file : 38
DW_AT_decl_line : 766
DW_AT_type : <dfb7e>
DW_AT_data_member_location: 3 byte block: 23 b8 1 (DW_OP_plus_uconst: 184)
readelf 能够打印出大量的类似这种的信息
作者:
tempname2
时间:
2011-10-28 09:12
那就不清楚了,可能是GDB的问题。虽然有点搞,试试用root运行。
作者:
luoyan_xy
时间:
2011-10-28 09:23
目前的问题是 如果用gdb调试内核vmcore gdb vmlinux vmcore
则会提示
warning: Couldn't find general-purpose registers in core file.
#0 0x0000000000000000 in ?? ()
(gdb) backtrace
Cannot access memory at address 0x0
(gdb) bt
Cannot access memory at address 0x0
作者:
wayling
时间:
2011-10-28 09:46
google一下, 你的的kernl是64bit吧??要用64bit版的GDB 试试吧
欢迎光临 Chinaunix (http://bbs.chinaunix.net/)
Powered by Discuz! X3.2