【发布时间】:2021-03-14 20:35:31
【问题描述】:
我有这样的功能:
int ConfigConvTensors(LayerType layer_type, bool batch_processing = false) {
/* Construct the convolution problem */
2=> std::list<std::string> input_coupled_vars;
std::list<std::string> weight_coupled_vars;
std::list<std::string> output_coupled_vars;
...
1=> someOtherFunction();
return 1;
3=> }
使用 gdb 进行调试时,光标从 1->2->3 移动。我认为这是由于析构函数。但是有没有办法告诉gdb:“不关心析构函数调试,只做1->3”?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=49951 似乎相关,但我正面临GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2 的这个问题。
我使用的命令行:
g++ -o cost-model/src/BASE_base-objects.o -c -O0 -g -std=c++17 $BunchOfLinkerAndIncludeFlags cost-model/src/BASE_base-objects.cpp
【问题讨论】:
-
现在还不是销毁局部变量的时候,除非您让优化器处理代码。优化后的代码更难调试,因为输出看起来像代码通过了搅拌机。我建议将编译器命令行添加到问题中。
标签: c++ gdb destructor