作者gigigigi (gigigigi)
看板LinuxDev
标题[问题] gdb debug linux module
时间Sun Jul 20 22:56:31 2014
我步骤
cd /sys/module/hello/sections
cat .text .data .bss // 取得 .text .data .bss address
0xbf000000
0xbf0003d5
0xbf0004e0
// 加入gdb
add-symbol-file ../hello_module/hello.ko 0xbf000000 -s .data 0xbf0003d5 -s .bss 0xbf0004e0
https://gist.github.com/anonymous/f999ebaddcc94749b837 // 程式码跟Makefile
(gdb) b hello_exit
Cannot access memory at address 0xbf00002c // 会出现这样错误
我记得我以前成功过, 请问有人知道原因吗?
谢谢
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 112.105.143.180
※ 文章网址: http://webptt.com/cn.aspx?n=bbs/LinuxDev/M.1405868195.A.99A.html
1F:推 PCIT:dmesg有没有错误? 07/22 05:16
2F:推 mimi0213:Alternatively, you can use gdb on a running kernel. 07/22 16:29
3F:→ mimi0213:(read-only; i.e. you cannot change values or set brea 07/22 16:30
4F:→ mimi0213:k points.) reference:README under kernel source 07/22 16:31