debug: supports scope (if, for)

This commit is contained in:
Li Jie
2024-09-29 16:20:41 +08:00
parent e392956e2a
commit 88cb607975
8 changed files with 274 additions and 95 deletions

View File

@@ -58,9 +58,8 @@ func (p BasicBlock) Addr() Expr {
// -----------------------------------------------------------------------------
type dbgExpr struct {
ptr Expr
val Expr
deref bool
ptr Expr
val Expr
}
type aBuilder struct {
@@ -70,7 +69,8 @@ type aBuilder struct {
Pkg Package
Prog Program
dbgVars map[Expr]dbgExpr
dbgVars map[Expr]dbgExpr // save copied address and values for debug info
diScopeCache map[*types.Scope]DIScope // avoid duplicated DILexicalBlock(s)
}
// Builder represents a builder for creating instructions in a function.