공유 라이브러리를로드하는 프로그램을 디버깅하려고합니다. 주 프로그램 부분은 완벽하게 디버깅 할 수 있지만 공유 라이브러리에서는 몇 가지 문제가 발생합니다.GDB가 공유 라이브러리에 중단 점을 설정할 수 없습니다.
gdb -p 70876
GNU gdb (GDB) 7.11.1
Copyright (C) 2016 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 "x86_64-apple-darwin15.5.0".
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".
Attaching to process 70876
Reading symbols from /usr/local/pgsql/bin/postgres...done.
0x00007fff9496a2a2 in poll() from /usr/lib/system/libsystem_kernel.dylib
(gdb) b multi_ProcessUtility
Breakpoint 1 at 0xdaa9: multi_ProcessUtility. (2 locations)
(gdb) b multi_utility.c:129
Cannot access memory at address 0xdaa9
(gdb)
따라서 문제는 메서드 이름 자체와 함께 중단 점을 설정할 수 있으며 프로그램이 지정된 지점에서 중지된다는 것입니다. 그러나 파일 이름과 줄 번호를 사용하여 중단 점을 설정할 수 없습니다.
프로그램 I 프로세스에 부착 한 때 No current source file.
메시지
으로 info source
명령 결과를 실행하고, 공유 라이브러리 함수 정지
저는 자작에서 GNU GCC 6 및 GDB 7.11.1을 사용하여 Mac OS X El Capitan에 있습니다. 메인 프로그램과 공유 라이브러리를 "-Og -ggdb -g3"플래그로 컴파일했습니다.