作者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://www.ptt.cc/bbs/LinuxDev/M.1405868195.A.99A.html
推 PCIT:dmesg有沒有錯誤? 07/22 05:16
推 mimi0213:Alternatively, you can use gdb on a running kernel. 07/22 16:29
→ mimi0213:(read-only; i.e. you cannot change values or set brea 07/22 16:30
→ mimi0213:k points.) reference:README under kernel source 07/22 16:31