nmindex support python

This commit is contained in:
xushiwei
2024-05-09 12:03:21 +08:00
parent d4dd0c00ff
commit 329f65a1ad
3 changed files with 21 additions and 13 deletions

View File

@@ -18,9 +18,10 @@ package main
import (
"fmt"
"log"
"os"
"github.com/goplus/llgo/x/nm"
"github.com/goplus/llgo/x/env/llvm"
)
func main() {
@@ -29,9 +30,8 @@ func main() {
return
}
nm := nm.New("nm")
nm := llvm.New().Nm()
items, err := nm.List(os.Args[1])
check(err)
for _, item := range items {
if item.File != "" {
fmt.Printf("\n%s:\n", item.File)
@@ -44,10 +44,7 @@ func main() {
}
}
}
}
func check(err error) {
if err != nil {
panic(err)
log.Println(err)
}
}