之前装Python3版本可能把ubuntu虚拟机环境弄坏了,导致gdb功能异常报错
test@ubuntu:/usr/bin$ gdb
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'
通过命令readelf -d gdb查看依赖库
test@ubuntu:~/Share/LiteSDK/.objs/ubuntu/sdk/test$ readelf -d /usr/bin/gdb
Dynamic section at offset 0x72db58 contains 41 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [libreadline.so.7]
0x0000000000000001 (NEEDED) Shared library: [libz.so.1]
0x0000000000000001 (NEEDED) Shared library: [libdl.so.2]
0x0000000000000001 (NEEDED) Shared library: [libncursesw.so.5]
0x0000000000000001 (NEEDED) Shar