728x90
반응형
https://stackoverflow.com/questions/30281766/need-to-load-debugging-symbols-for-shared-library-in-gdb/66562021#66562021
요약
gdb에서 load한 shared libary의 시작 주로를 확인
(gdb) add-symbol-file {symbol 정보가있는 library 경로} {info shared library에 나오는 library의 FROM 값}
Loading debug symbols for a shared library
If the shared library is stripped, and the debug symbols are provided as a separate file, you need to load them after the shared library was loaded by the linker. The symbols should be loaded on the memory address where the shared library is loaded.
Following is an example of loading the symbols:
- Find the memory location where the shared library that you want to debug was loaded (in this example the library is libtest.so.1so, the library is loaded starting from memory address 0x0000fffff7f9f890
- (gdb) info sharedlibrary
From To Syms Read Shared Object Library
0x0000fffff7fcd0c0 0x0000fffff7fe5468 Yes (*) /lib/ld-linux-aarch64.so.1
0x0000fffff7f9f890 0x0000fffff7fb65c0 Yes (*) /usr/local/lib/libtest.so.1
0x0000fffff7e4bbc0 0x0000fffff7f3b190 Yes /lib/aarch64-linux-gnu/libc.so.6
0x0000fffff7dfea50 0x0000fffff7e0ddec Yes /lib/aarch64-linux-gnu/libpthread.so.0 - Load the symbol file with the address from the share library
- (gdb) add-symbol-file ./libsrc/libtest.dbg 0x0000fffff7f9f890
add symbol table from file "./libsrc/libtest.dbg" at .text_addr = 0xfffff7f9f890 (y or n) y
Reading symbols from ./libsrc/libtest.dbg...
728x90
반응형
'프로그래밍 > 리눅스 프로그래밍' 카테고리의 다른 글
[Debugging] Linux application debugging (0) | 2023.11.03 |
---|---|
[linux] netfilter 소개 및 동작 방식 (0) | 2023.07.09 |
[Hook ] LD_PRELOAD (0) | 2023.07.05 |
[stress] stress 사용법 (0) | 2023.02.28 |
[linux] libc 와 glibc 와 libstdc++ 와 gcc의 관계 정리 (0) | 2022.10.19 |