c++ - 由于 c++ 析构函数导致 gdb 跳转
问题描述
我的功能如下:
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
解决方案
看看生成的代码,它可以提供一些关于正在发生的事情的洞察力,可以是某种优化。 https://visualgdb.com/gdbreference/commands/disassemble
推荐阅读
- go - kubernetes go-client:如何使用 kubeconfig 文件刷新令牌
- jmeter - 修改线程组之间的变量
- r - 为什么尽管使用了warning=FALSE,但“加入,按=”消息会在Rmarkdown代码块中渗出?我应该报告为错误吗?
- amazon-web-services - alpine aarch64 无法安装和运行 aws-cli v2
- html - 媒体查询仅使用 !important ,即使将其放在样式表的末尾
- css - 与 React、Typescript 和 typescript-plugin-css-modules 一起使用时未应用 CSS
- wordpress - 我们可以使用任何插件将 wordpress 站点 1 中的帖子自动更新到 wordpress 站点 2 吗?
- asp.net-mvc - 没有 MediaTypeFormatter 可用于从媒体类型为“文本/日历”的内容中读取“文件流结果”类型的对象
- python - 如何将 Pandas 数据框中的某些行转换为列
- c++ - std::string str(array.begin(), array.end()) 是否自行添加空字符?