How to set a breakpoint in GDB where the function returns?(如何在函数返回的 GDB 中设置断点?)
问题描述
我有一个 C++ 函数,它在不同的地方有很多 return 语句.如何在函数实际返回的return语句处设置断点?
I have a C++ function which has many return statements at various places. How to set a breakpoint at the return statement where the function actually returns ?
没有参数的break"命令是什么意思?
And what does "break" command without argument means?
推荐答案
break without arguments 在当前选定堆栈帧中的下一条指令处停止执行.您可以通过 frame
或 up
和 down
命令选择跟踪帧.如果要调试实际上离开当前函数的点,请选择下一个外部框架并在那里中断.
break without arguments stops execution at the next instruction in the currently selected stack frame. You select strack frames via the frame
or up
and down
commands. If you want to debug the point where you are actually leaving the current function, select the next outer frame and break there.
这篇关于如何在函数返回的 GDB 中设置断点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在函数返回的 GDB 中设置断点?
基础教程推荐
- 为 C/C++ 中的项目的 makefile 生成依赖项 2022-01-01
- 如何在不破坏 vtbl 的情况下做相当于 memset(this, ...) 的操作? 2022-01-01
- Windows Media Foundation 录制音频 2021-01-01
- 为什么语句不能出现在命名空间范围内? 2021-01-01
- 使用从字符串中提取的参数调用函数 2022-01-01
- 从 std::cin 读取密码 2021-01-01
- 管理共享内存应该分配多少内存?(助推) 2022-12-07
- 在 C++ 中循环遍历所有 Lua 全局变量 2021-01-01
- 如何使图像调整大小以在 Qt 中缩放? 2021-01-01
- 如何“在 Finder 中显示"或“在资源管理器中显 2021-01-01