是否可以访问代码中的调用堆栈?
Can I have access to the call stack in my code?
假设我有一个函数:
firstFunction(){
//some code here
secondFunction();//call secondFunction
}
在里面secondFunction()
secondFunction(){
//some code here
//here call the function that called this ( in this case firstFunction() )
}
我想调用在该调用堆栈函数中的下一个函数中调用另一个函数的任何函数,而无需显式编写函数的名称。这可能吗?
C++没有明确提供此功能。有一些库可用于打印回溯,但如果函数是内联的,则可以从列表中省略它们。
您可能需要使用一些函数参数自己跟踪它。
相关文章:
- Visual Studio(或任何其他工具)能否将地址解释为调用堆栈(boost上下文)的开头
- 为什么调用堆栈数组会导致内存泄漏
- 是否可以检查悬挂光纤的调用堆栈?
- MSVC __debugbreak() 与 openGL 错误回调一起使用时不会产生调用堆栈
- 以下代码如何工作以每次为唯一调用堆栈唯一实例化模板函数?
- OpenCV 3 Visual Studio 2017 调试,调用堆栈没有.pdb文件
- C/C++中全局调用堆栈的基础
- 是否可以访问代码中的调用堆栈?
- 调用堆栈显示 SIGBUS,这意味着什么
- 打开C++故障转储不会在调用堆栈中显示正确的行
- 将参数推送到调用堆栈 (C++) 的可移植方法
- 是否可以将功能调用堆栈放在堆上
- 未定义对调用堆栈库的引用出现问题
- 我无法获得由 Clang 构建的优化 NDK 应用程序的调用堆栈
- 调用堆栈中的访问冲突
- GDB正在调试一个缺少特定调用堆栈的符号表的核心转储
- C++按引用传递:如何使用调用堆栈
- 从系统调用内部生成调用堆栈
- 使用 .Net 4.0 时出现堆栈不平衡错误,但在使用 .Net 2.0 时不调用堆栈不平衡错误
- 生成所有可能的调用堆栈的树