커널 모듈에서 API가 반환하는 내용을 알고 싶습니다. < vnos-module.ko>.gdb를 사용하여 Linux 커널 모듈 디버그
커널 모듈을 디버깅하기 위해 심볼 테이블을로드해야하는 몇 가지 형식에서 알 수 있습니다.
그래서 내가 한 것은 입니다. 1. .text .bss와 커널 모듈의 .data 섹션 주소를 찾으려고했습니다. 2. gdb에서 add-symbol-file 명령을 사용하여 기호 테이블 파일을 추가하십시오.
하지만 "/fabos/modules/vnos-module.ko...((디버깅 기호가 없습니다.) ... 완료되었습니다."라는 오류 메시지가 나타납니다.
여기에 누락 된 것이 있습니까?
[email protected]:/sys/module/vnos_module/sections# cat .text .data .bss
0xf7f7f000
0xf7fb7a30
0xf7fc3da4
[email protected]:/sys/module/vnos_module/sections# gdb /fabos/modules/vnos-module.ko
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /fabos/modules/vnos-module.ko...(no debugging symbols found)...done.
add-symbol-file /fabos/modules/vnos-module.ko 0xf7f7f000 -s .data 0xf7fb7a -s .bss 0xf7fc3da4
add symbol table from file "/fabos/modules/vnos-module.ko" at
.text_addr = 0xf7f7f000
.data_addr = 0xf7fb7a30
(y or n) y
Reading symbols from /fabos/modules/vnos-module.ko...(no debugging symbols found)...done.
도와주세요.
파일에 기호가없는 경우 기호가 없습니다. 섹션의 주소를 알고 있어도 디버그 할 수 없습니다. 기호가있는 파일이나 바이너리에 해당하는 별도의 기호 파일을 얻어야합니다. –
심볼을 통합하기 위해 모듈을 컴파일하는 방법이 있습니까? –