【发布时间】:2021-11-18 02:38:14
【问题描述】:
我知道在调试时可以使用 .natvis 文件自定义对象在 Visual Studio 中的显示方式。
有没有办法修改调试器的行为以单步执行某些成员函数而不是单步执行它们?
例如:
class pt{
double x, y;
pt::pt(double x, double y) : x(x), y(y){} // <--- I don't want to step into this stuff in debugger
}
void some_function(pt const &point){
// stuff that I want to step through in the debugger
}
int main(){
// this will call the constructor for pt. I want to step into 'some_function'
// but I don't want to step into the pt constructor
some_function({1, 2}); // I would like to step into this function without stepping into pt::pt first
return 0;
}
当我进入对 some_function 的调用时,有没有办法使用 natvis 文件来指定我不想进入示例中像“pt”这样的类的构造函数?
(我知道可以执行具体步骤,但我不想在这种情况下这样做。)
【问题讨论】:
标签: visual-studio debugging visual-studio-debugging