package code import "jinx/pkg/libs/rangemap" type DebugInfo struct { file string pcToLine rangemap.RangeMap[int] } func NewDebugInfo(file string) DebugInfo { return DebugInfo{ file: file, pcToLine: rangemap.New[int](), } } func (di *DebugInfo) File() string { return di.file } func (di *DebugInfo) PCToLine(pc int) int { line, ok := di.pcToLine.Get(pc) if !ok { return -1 } return *line } func (di *DebugInfo) AppendLine(uptoPc, line int) { di.pcToLine.AppendToLast(uptoPc, line) }