make runtime compatible with wasm
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
//go:build !wasm
|
||||
|
||||
package debug
|
||||
|
||||
/*
|
||||
#cgo linux LDFLAGS: -lunwind
|
||||
*/
|
||||
import "C"
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
@@ -11,8 +9,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
LLGoPackage = "link"
|
||||
LLGoFiles = "_wrap/debug.c"
|
||||
LLGoFiles = "_wrap/debug.c"
|
||||
)
|
||||
|
||||
type Info struct {
|
||||
|
||||
33
runtime/internal/clite/debug/debug_wasm.go
Normal file
33
runtime/internal/clite/debug/debug_wasm.go
Normal file
@@ -0,0 +1,33 @@
|
||||
package debug
|
||||
|
||||
import (
|
||||
"unsafe"
|
||||
|
||||
c "github.com/goplus/llgo/runtime/internal/clite"
|
||||
)
|
||||
|
||||
type Info struct {
|
||||
Fname *c.Char
|
||||
Fbase c.Pointer
|
||||
Sname *c.Char
|
||||
Saddr c.Pointer
|
||||
}
|
||||
|
||||
func Address() unsafe.Pointer {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
func Addrinfo(addr unsafe.Pointer, info *Info) c.Int {
|
||||
panic("not implemented")
|
||||
}
|
||||
|
||||
type Frame struct {
|
||||
PC uintptr
|
||||
Offset uintptr
|
||||
SP unsafe.Pointer
|
||||
Name string
|
||||
}
|
||||
|
||||
func StackTrace(skip int, fn func(fr *Frame) bool) {
|
||||
panic("not implemented")
|
||||
}
|
||||
7
runtime/internal/clite/debug/libunwind.go
Normal file
7
runtime/internal/clite/debug/libunwind.go
Normal file
@@ -0,0 +1,7 @@
|
||||
//go:build !linux
|
||||
|
||||
package debug
|
||||
|
||||
const (
|
||||
LLGoPackage = "link"
|
||||
)
|
||||
7
runtime/internal/clite/debug/libunwind_linux.go
Normal file
7
runtime/internal/clite/debug/libunwind_linux.go
Normal file
@@ -0,0 +1,7 @@
|
||||
//go:build linux
|
||||
|
||||
package debug
|
||||
|
||||
const (
|
||||
LLGoPackage = "link: -lunwind"
|
||||
)
|
||||
Reference in New Issue
Block a user