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 中设置断点?
基础教程推荐
- 常量变量在标题中不起作用 2021-01-01
- 这个宏可以转换成函数吗? 2022-01-01
- C++结构和函数声明。为什么它不能编译? 2022-11-07
- 如何通过C程序打开命令提示符Cmd 2022-12-09
- 我有静态或动态 boost 库吗? 2021-01-01
- 如何检查GTK+3.0中的小部件类型? 2022-11-30
- 在 C++ 中计算滚动/移动平均值 2021-01-01
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01
- 如何在 C++ 中初始化静态常量成员? 2022-01-01
