GDB发出奇怪的错误

时间:2019-09-26 23:00:28

标签: c++ macos gdb

我像这样运行我的gdb程序:

(gdb) r < err.in                                                                                                                                                                                                                                                                                                              

并收到以下警告:

Starting program: /Users/prikshetsharma/Downloads/parser/parse < err.in                                                                                                                                                                                                                                                       
[New Thread 0x1003 of process 39841]                                                                                                                                                                                                                                                                                          
[New Thread 0x1103 of process 39841]                                                                                                                                                                                                                                                                                          
[New Thread 0x1503 of process 39841]                                                                                                                                                                                                                                                                                          
warning: `/BuildRoot/Library/Caches/com.apple.xbs/Binaries/Libc_darwin/install/TempContent/Objects/Libc.build/libsystem_darwin.dylib.build/Objects-normal/x86_64/bsd.o': can't open to read symbols: No such file or directory.                                                                                               
warning: `/BuildRoot/Library/Caches/com.apple.xbs/Binaries/Libc_darwin/install/TempContent/Objects/Libc.build/libsystem_darwin.dylib.build/Objects-normal/x86_64/darwin_vers.o': can't open to read symbols: No such file or directory.                                                                                       
warning: `/BuildRoot/Library/Caches/com.apple.xbs/Binaries/Libc_darwin/install/TempContent/Objects/Libc.build/libsystem_darwin.dylib.build/Objects-normal/x86_64/dirstat.o': can't open to read symbols: No such file or directory.                                                                                           
warning: `/BuildRoot/Library/Caches/com.apple.xbs/Binaries/Libc_darwin/install/TempContent/Objects/Libc.build/libsystem_darwin.dylib.build/Objects-normal/x86_64/dirstat_collection.o': can't open to read symbols: No such file or directory.                                                                                
warning: `/BuildRoot/Library/Caches/com.apple.xbs/Binaries/Libc_darwin/install/TempContent/Objects/Libc.build/libsystem_darwin.dylib.build/Objects-normal/x86_64/err.o': can't open to read symbols: No such file or directory.                                                                                               
warning: `/BuildRoot/Library/Caches/com.apple.xbs/Binaries/Libc_darwin/install/TempContent/Objects/Libc.build/libsystem_darwin.dylib.build/Objects-normal/x86_64/exception.o': can't open to read symbols: No such file or directory.                                                                                         
warning: `/BuildRoot/Library/Caches/com.apple.xbs/Binaries/Libc_darwin/install/TempContent/Objects/Libc.build/libsystem_darwin.dylib.build/Objects-normal/x86_64/init.o': can't open to read symbols: No such file or directory.                                                                                              
warning: `/BuildRoot/Library/Caches/com.apple.xbs/Binaries/Libc_darwin/install/TempContent/Objects/Libc.build/libsystem_darwin.dylib.build/Objects-normal/x86_64/mach.o': can't open to read symbols: No such file or directory.                                                                                              
warning: `/BuildRoot/Library/Caches/com.apple.xbs/Binaries/Libc_darwin/install/TempContent/Objects/Libc.build/libsystem_darwin.dylib.build/Objects-normal/x86_64/stdio.o': can't open to read symbols: No such file or directory.                                                                                             
warning: `/BuildRoot/Library/Caches/com.apple.xbs/Binaries/Libc_darwin/install/TempContent/Objects/Libc.build/libsystem_darwin.dylib.build/Objects-normal/x86_64/stdlib.o': can't open to read symbols: No such file or directory.                                                                                            
warning: `/BuildRoot/Library/Caches/com.apple.xbs/Binaries/Libc_darwin/install/TempContent/Objects/Libc.build/libsystem_darwin.dylib.build/Objects-normal/x86_64/string.o': can't open to read symbols: No such file or directory.                                                                                            
warning: `/BuildRoot/Library/Caches/com.apple.xbs/Binaries/Libc_darwin/install/TempContent/Objects/Libc.build/libsystem_darwin.dylib.build/Objects-normal/x86_64/variant.o': can't open to read symbols: No such file or directory.

这些警告是什么,以及如何消除它们?如何获取这些文件和目录?

1 个答案:

答案 0 :(得分:0)

  

这些警告是什么

libsystem_darwin.dylib是使用-fsplit-dwarf或等效选项构建的。该选项将大多数调试信息保留在目标文件中,并在.o中保留对.dylib文件的引用,以便调试器可以找到原始的.o并加载调试信息。从它。

这使.dylib小得多,同时仍然允许完全访问调试信息。

  

如何摆脱它们?

您可以使用strip libsystem_darwin.dylib(或等效于MacOS的操作系统–我不确定strip是否存在)摆脱调试引用。或者只是忽略它们。