1
0
mirror of https://github.com/ioacademy-jikim/debugging synced 2025-06-06 23:46:15 +00:00
debugging/01_day/backtrace/backtrace_2.c
2015-12-13 22:34:58 +09:00

18 lines
247 B
C

#include <stdio.h>
typedef struct layout
{
struct layout* ebp;
void* ret;
} layout;
void print_gnu_backtrace()
{
layout* ebp = __builtin_frame_address(0);
while( ebp )
{
printf("0x%08x\n", (unsigned int)ebp->ret );
ebp = ebp->ebp;
}
}