2016-07-22 4 views
1

공유 라이브러리를로드하는 프로그램을 디버깅하려고합니다. 주 프로그램 부분은 완벽하게 디버깅 할 수 있지만 공유 라이브러리에서는 몇 가지 문제가 발생합니다.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"플래그로 컴파일했습니다.

답변

1

gdb 6.3.50으로 다운 그레이드하여 문제를 해결했습니다.

기본적으로 macports에서 gdb-apple을 설치했으며 gdb 6.3.50을 기반으로합니다. 나는 그것이 gdb 버전과 관련이 있는지 또는 gdb-apple 포트가 작동하는지 약간의 개조가 있는지를 모른다.

관련 문제