设置条件时 lldb 失败
lldb fails when setting condition
我用 clang++ -std=c++17 -g try.cpp
编译了我的文件
现在在 lldb 上,
(lldb) b Board.cpp:27
Breakpoint 1: where = a.out`Board::move(Point const&, Point const&, std::__1::vector<std::__1::vector<float, std::__1::allocator<float> >, std::__1::allocator<std::__1::vector<float, std::__1::allocator<float> > > > const&, int, float) + 40 at Board.cpp:27:28, address = 0x0000000100001558
(lldb) b Board.cpp:27 -c 'prob==0.1'
Breakpoint 2: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations
我正在使用 Mojave,
~ lldb --version
lldb-1001.0.13.3
Swift-5.0
为什么设置-c
失败,而省略却没有?
这是 b
命令中的错误。 b
命令不是 "real" lldb 断点设置命令 - 即 break set
。 b
是一个基于 lldb "regex" 的命令,它尝试模拟 gdb 断点解析器 - 然后分派到 break set
。添加它是为了让来自 gdb 的人可以更轻松地使用 lldb。但显然它没有正确处理 -c 标志。按照您的指定设置断点后,您将看到:
(lldb) b Board.cpp:27 -c 'prob==0.1'
Breakpoint 1: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations.
(lldb) break list
Current breakpoints:
1: name = 'Board.cpp:27 -c prob==0.1', locations = 0 (pending)
所以 b
认为您试图使用整个字符串设置 "function name" 断点。请用 http://bugs.llvm.org 归档。
您可以使用 break set
设置您尝试设置的断点,例如:
(lldb) br s -f Board.cpp -l 27 -c 'prob==0.1'
我用 clang++ -std=c++17 -g try.cpp
编译了我的文件
现在在 lldb 上,
(lldb) b Board.cpp:27
Breakpoint 1: where = a.out`Board::move(Point const&, Point const&, std::__1::vector<std::__1::vector<float, std::__1::allocator<float> >, std::__1::allocator<std::__1::vector<float, std::__1::allocator<float> > > > const&, int, float) + 40 at Board.cpp:27:28, address = 0x0000000100001558
(lldb) b Board.cpp:27 -c 'prob==0.1'
Breakpoint 2: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations
我正在使用 Mojave,
~ lldb --version
lldb-1001.0.13.3
Swift-5.0
为什么设置-c
失败,而省略却没有?
这是 b
命令中的错误。 b
命令不是 "real" lldb 断点设置命令 - 即 break set
。 b
是一个基于 lldb "regex" 的命令,它尝试模拟 gdb 断点解析器 - 然后分派到 break set
。添加它是为了让来自 gdb 的人可以更轻松地使用 lldb。但显然它没有正确处理 -c 标志。按照您的指定设置断点后,您将看到:
(lldb) b Board.cpp:27 -c 'prob==0.1'
Breakpoint 1: no locations (pending).
WARNING: Unable to resolve breakpoint to any actual locations.
(lldb) break list
Current breakpoints:
1: name = 'Board.cpp:27 -c prob==0.1', locations = 0 (pending)
所以 b
认为您试图使用整个字符串设置 "function name" 断点。请用 http://bugs.llvm.org 归档。
您可以使用 break set
设置您尝试设置的断点,例如:
(lldb) br s -f Board.cpp -l 27 -c 'prob==0.1'