cl:compile with clang++

This commit is contained in:
luoliwoshang
2025-06-11 17:01:12 +08:00
parent 47c119a2d7
commit f2f93c7f5f
7 changed files with 23 additions and 21 deletions

View File

@@ -9,13 +9,11 @@
#include <dlfcn.h>
#include <libunwind.h>
void *llgo_address() {
return __builtin_return_address(0);
}
extern "C" {
int llgo_addrinfo(void *addr, Dl_info *info) {
return dladdr(addr, info);
}
void *llgo_address() { return __builtin_return_address(0); }
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;
@@ -33,9 +31,10 @@ 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;
}
}
}
}
}
}

View File

@@ -9,7 +9,7 @@ import (
)
const (
LLGoFiles = "_wrap/debug.c"
LLGoFiles = "_wrap/debug.cpp"
)
type Info struct {