1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2024-10-30 11:54:01 -04:00
This commit is contained in:
Alex Kotov 2022-12-04 01:22:31 +04:00
parent 025667f1d4
commit eae451ee75
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
2 changed files with 5 additions and 2 deletions

View file

@ -22,11 +22,13 @@ struct KernAux_StackTrace_Frame KernAux_StackTrace_Frame_create()
struct KernAux_StackTrace_Frame frame = { .cur_ptr = NULL };
#if defined(ASM_I386)
const size_t *cur_ptr = frame.cur_ptr;
const size_t *cur_ptr;
KERNAUX_ASM("movl %%ebp, %0" : "=g" (cur_ptr) :: "memory");
frame.cur_ptr = cur_ptr;
#elif defined(ASM_X86_64)
const size_t *cur_ptr = frame.cur_ptr;
const size_t *cur_ptr;
KERNAUX_ASM("movq %%rbp, %0" : "=g" (cur_ptr) :: "memory");
frame.cur_ptr = cur_ptr;
#endif
return frame;

View file

@ -39,6 +39,7 @@ static const void *max_addresses[MAX_SIZE];
++lower##_count; \
} \
\
assert(lower##_count >= 2); \
putchar('\n'); \
} while (0)