【发布时间】:2020-11-24 16:03:38
【问题描述】:
我尝试按照说明进行操作 here,但收到了 unable to resolve breakpoint to any actual location 警告。这就是我所做的。我首先使用-g 标志编译代码:
c++ -g -Wall -shared -std=c++11 -undefined dynamic_lookup `python3 -m pybind11 --includes` fractal.cpp -o fractal`python3-config --extension-suffix`
然后,我从命令行启动 python,它设置为运行系统 python 3.8.5。我用
检查pid
ps aux | grep -i python
在另一个终端窗口中,我启动 lldb 并输入
attach --pid 77352
其余的都是这样的:
(lldb) continue
Process 77352 resuming
(lldb) breakpoint set -f fractal.cpp -l 66
Breakpoint 1: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations.
我错过了什么?由于 pybind11 直到调用 python 脚本结束时才会在 C++ 代码中打印错误,所以我不能只将内容打印到屏幕上以查看代码在哪里发生故障。我希望能够逐行浏览代码。
我使用的是 macOS 10.15.5,如果有什么不同的话。我还仔细检查了我在 fractal.cpp 中选择的有效行。
【问题讨论】: