compiler: split LLGO_DEBUG into LLGO_DEBUG, LLGO_DBG_SYMBOLS, disableInline

This commit is contained in:
Li Jie
2025-02-22 09:31:41 +08:00
parent 9f38338c58
commit 8cd5924bf2
7 changed files with 45 additions and 27 deletions

View File

@@ -33,11 +33,16 @@ func GenFrom(fileOrPkg string) string {
func genFrom(pkgPath string) (build.Package, error) {
oldDbg := os.Getenv("LLGO_DEBUG")
oldDbgSyms := os.Getenv("LLGO_DEBUG_SYMBOLS")
dbg := isDbgSymEnabled(filepath.Join(pkgPath, "flags.txt"))
if dbg {
os.Setenv("LLGO_DEBUG", "1")
os.Setenv("LLGO_DEBUG_SYMBOLS", "1")
}
defer os.Setenv("LLGO_DEBUG", oldDbg)
defer func() {
os.Setenv("LLGO_DEBUG", oldDbg)
os.Setenv("LLGO_DEBUG_SYMBOLS", oldDbgSyms)
}()
conf := &build.Config{
Mode: build.ModeGen,