mirror of
https://github.com/ioacademy-jikim/debugging
synced 2025-06-07 07:56:19 +00:00
18 lines
247 B
C
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;
|
|
}
|
|
}
|