chore:keep origin c format

This commit is contained in:
luoliwoshang
2025-06-11 20:30:44 +08:00
parent efabdf27c8
commit 4f5c95045d
7 changed files with 41 additions and 26 deletions

View File

@@ -11,9 +11,13 @@
extern "C" {
void *llgo_address() { return __builtin_return_address(0); }
void *llgo_address() {
return __builtin_return_address(0);
}
int llgo_addrinfo(void *addr, Dl_info *info) { return dladdr(addr, info); }
int llgo_addrinfo(void *addr, Dl_info *info) {
return dladdr(addr, info);
}
void llgo_stacktrace(int skip, void *ctx, int (*fn)(void *ctx, void *pc, void *offset, void *sp, char *name)) {
unw_cursor_t cursor;
@@ -31,10 +35,11 @@ void llgo_stacktrace(int skip, void *ctx, int (*fn)(void *ctx, void *pc, void *o
if (unw_get_reg(&cursor, UNW_REG_IP, &pc) == 0) {
unw_get_proc_name(&cursor, fname, sizeof(fname), &offset);
unw_get_reg(&cursor, UNW_REG_SP, &sp);
if (fn(ctx, (void *)pc, (void *)offset, (void *)sp, fname) == 0) {
if (fn(ctx, (void*)pc, (void*)offset, (void*)sp, fname) == 0) {
return;
}
}
}
}
}