GDB 执行报异常问题解决方案
摘要
本文详细分析了 GDB 执行报异常 “Can’t open file” 的原因,解释了其对调试的影响,并提供了一套完整的解决方案,包括获取目标板的库文件、设置 GDB 的搜索路径等,帮助开发者在调试过程中解决因缺少目标板运行时库文件而导致的调试受限问题。
问题描述
在使用 GDB 进行调试时,出现以下报异常信息:
warning: Can't open file /usr/lib/libupkcs11.so during file-backed mapping note processing
warning: Can't open file /usr/lib/librtlsdk.so during file-backed mapping note processing
warning: Can't open file /usr/lib/librsaverify.so during file-backed mapping note processing
warning: Can't open file /usr/lib/libxml2.so.2.12.7 during file-backed mapping note processing
warning: Can't open file /usr/lib/librtlswitch.so during file-backed mapping note processing
warning: Can't open file /usr/lib/libinstaller.so during file-backed mapping note processing
原因分析
- 路径差异 :程序是在目标设备(如 ARM 开发板)上崩溃的,运行时加载了位于目标设备绝对路径下的共享库文件。而当前调试环境是在 x86_64 主机(可能是 Windows 下的

最低0.47元/天 解锁文章
59

被折叠的 条评论
为什么被折叠?



