runtime: add line info for stack frames#1926
Conversation
570148d to
366b139
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Added c9c9cad to cover the Codecov patch gap in cl/compile.go.\n\nWhat changed:\n- Added TestDebugOnlyValueReferrerHelpers in cl/builtin_test.go.\n- It directly covers hasNoSemanticReferrers, debugOnlyPureValue, and the compileInstr debug-only pure value skip branch.\n\nLocal verification:\n- go test ./cl -run 'Test(DebugOnlyValueReferrerHelpers|CompileLargeNilDerefInterfaceGuards)$' -coverprofile=/tmp/llgo-cl-focused.cover\n - go tool cover shows hasNoSemanticReferrers: 100%, debugOnlyPureValue: 100%, and the compileInstr skip branch covered.\n- go test ./cl -run 'Test(DebugOnlyValueReferrerHelpers|CompileLargeNilDerefInterfaceGuards|CompileRangeFuncDeferModule|RangeFuncDeferAnalysisHelpers)$' -count=1\n\nCI/Codecov are pending a fresh run for the new head commit. |
|
Resolved the latest merge conflict with xgo-dev/main (51d665e). Kept this PR's broader litgen debug metadata handling and did not re-add fixedbugs/issue29735.go to xfail, since it is covered by this PR.\n\nLocal verification:\n- go test -timeout 20m ./chore/litgen -count=1\n- go test -timeout 20m ./cl -run 'Test(DebugOnlyValueReferrerHelpers|CompileLargeNilDerefInterfaceGuards|CompileRangeFuncDeferModule|RangeFuncDeferAnalysisHelpers)$' -count=1\n- git diff --check |
7ed5055 to
b16bf62
Compare
14adc9f to
4a27076
Compare
4275534 to
6fdeaee
Compare
44f8a93 to
182c665
Compare
182c665 to
94b2350
Compare
| goName = funcName(pkgTypes, f, false) | ||
| } | ||
| pos := p.goProg.Fset.Position(f.Pos()) | ||
| pkg.EmitFuncInfo(fn.Name(), goName, pos.Filename, pos.Line, pos.Column) |
There was a problem hiding this comment.
这里记录的原始信息是函数定义的位置的文件名 行号等信息 这样的话 运行时恢复的堆栈就也是定义的位置,而不是调用的位置,这个是预期的吗?
There was a problem hiding this comment.
之前是自定义定义位置加上 llvm-symbolizer,感觉太重了,这个 PR 先移掉。#2002 尝试把调用行也加进来,对比一下数据和运行时开销,先 draft
Adds compact LLGo runtime funcinfo metadata and uses it for stack/function lookup.
runtime.Caller,CallersFrames,FuncForPC,runtime.Stack, anddebug.Stackthroughdladdr, cachedStackTraceframe names, and funcinfo. Linux funcinfo executables narrowly export main-frame dynamic symbols fordladdr.LLGO_LINEINFO/DWARF/dSYM/llvm-symbolizerpath; this PR provides function-level source positions, not statement-level line tables.Tests cover funcinfo encoding/table emission, DCE safety, Linux link flags,
//go:noinlineattributes, renamed symbols,Caller/CallersFrames/FuncForPC/Stack/debug.Stack, andfixedbugs/issue29735.go.