用户工具

站点工具


侧边栏

[侧边栏]

侧栏编辑 后台管理
GIT仓库
老web
C++Reference
快速笔记 笔记浏览

working:7_随笔随记:未整理:linux进程内查看函数调用堆栈

https://blog.csdn.net/zxh821112/article/details/8432925

#include <execinfo.h>
#include <stdio.h>
#include <stdlib.h>
void func_backtrace_test(void)
{
	void *array[10];
	size_t size;
	char **strings;
	size_t i;

	size = backtrace (array, 10);
	printf ("Obtained %zd stack frames.\n", size);
	strings = backtrace_symbols (array, size);
	for (i = 0; i < size; i++)
	{
		printf ("%s\n", strings[i]);
	}
	free (strings);

	return ;
}
working/7_随笔随记/未整理/linux进程内查看函数调用堆栈.txt · 最后更改: 2020/10/20 12:42 由 wenliang