【发布时间】:2015-11-28 05:40:34
【问题描述】:
我正试图弄清楚如何在我的代码中设置更复杂的断点。
我想对特定值进行中断(例如,当我的结构的第一个字段等于 42 时中断)
struct SpecificKey
{
int myFirstField;
int mySecondField;
};
int Get(const SpecificKey& key)
{
// <--- set conditional break point if key.myFirstField==42
//
// Look for value somewhere...
//
return 0;
}
int main()
{
int value = Get({42, 56});
return 0;
}
我在 Visual Studio 2010 中尝试过,但它无法与 key.myFirstField==42 正确断开
可以实现吗?如果有,怎么做?
【问题讨论】:
-
在 VS 2015 社区版中运行良好。
标签: c++ visual-studio visual-studio-2010 debugging breakpoints