【发布时间】:2017-02-14 10:43:09
【问题描述】:
我倾向于使用很多虚拟环境,尤其是 Python。我在特定虚拟环境中运行的一些代码并包含一些 C++ 代码。此代码核心转储,我想使用lldb 对其进行调试。
但是,我明白了
; lldb a.out -c core.17915
Core file '/path/core.17915' (x86_64) was loaded.
Process 0 stopped
* thread #1: tid = 0, 0x0000000000559689
[...] ← lots of irrelevant data for this question.
(lldb) frame variable
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named lldb.embedded_interpreter
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
Traceback (most recent call last):
File "<string>", line 1, in <module>
NameError: name 'run_one_line' is not defined
zsh: segmentation fault (core dumped) lldb a.out -c core.17915
我可以导入在虚拟环境之外运行的 lldb,但不能在虚拟环境中执行此操作。我不希望将所有系统模块都添加到虚拟环境中,因为这样一开始就违背了拥有虚拟环境的意义。
如何在我的虚拟环境中加载lldb 模块?
【问题讨论】:
-
我在 Ubuntu 16.10 上遇到过类似的错误,原来
python-lldb-3.8没有被标记为依赖项,必须手动安装。
标签: python virtualenv lldb