limit the number of stack frames we get

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2024-02-12 18:22:58 +00:00
parent 40be723870
commit 0cd4b26663
No known key found for this signature in database
GPG Key ID: D3A4405BE6CC17F4
1 changed files with 1 additions and 1 deletions

View File

@ -22,7 +22,7 @@ void backtrace() {
int n = 0;
size_t buffer_offset = 0;
while (unw_step(&cursor)) {
while (unw_step(&cursor) && n < 10) {
unw_word_t ip, sp, off;
unw_get_reg(&cursor, UNW_REG_IP, &ip);