【发布时间】:2016-09-09 07:53:38
【问题描述】:
我想用 lldb 设置一个条件断点。这通常使用-c 选项来完成:
breakpoint set -f myFile.cpp -l 123 -c 'a==3'
但是,就我而言,我想测试 std::string 对象是否等于某个字符串值,但这样做
breakpoint set -f myFile.cpp -l 123 -c 'a=="hello"'
不起作用... Lldb 不会抱怨(虽然 gdb 会返回错误)但它会在到达断点时忽略条件字符串并且过早中断...
这个问题类似于this one,但使用的是 lldb 而不是 gdb。那里提出的解决方案
breakpoint set -f myFile.cpp -l 123 if strcmp(a, "hello")==0
似乎对 lldb 无效
使用的 Lldb 版本:3.4
【问题讨论】:
标签: breakpoints lldb conditional-breakpoint