Go debug/gosym: read Go symbol and line-number tables
Answer: The debug/gosym package reads the Go symbol and line-number tables produced by the gc compilers.
Tables and lookups
The package implements access to the Go symbol and line number tables generated by the gc compilers.
It returns UnknownFileError or UnknownLineError if there is an error looking up this line. If there is no information, it returns fn == nil.
Objects across Go versions
In early Go releases, each source file became a separate Obj. Since Go 1.2 there is a single Obj for the entire program, and Paths is nil on that newer table.
See also
Claims
- id: C1 claim: The package reads the Go symbol and line-number tables from gc. source: S2 evidence: "Package gosym implements access to the Go symbol"
- id: C2 claim: In early versions, each source file became a different Obj. source: S1 evidence: "In early versions of Go each source file became a different Obj."
- id: C3 claim: In Go 1.2 there is a single Obj for the entire program. source: S1 evidence: "In Go 1.2, there is a single Obj for the entire program."
Sources
- [S1] debug/gosym. The Go Authors. https://pkg.go.dev/debug/gosym . License: BSD-3-Clause. Accessed 2026-11-26.
- [S2] debug/gosym source. The Go Authors. https://go.dev/src/debug/gosym/symtab.go . License: BSD-3-Clause. Accessed 2026-11-26.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: The Go Authors, debug/gosym; The Go Authors, debug/gosym source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: The Go Authors, debug/gosym; The Go Authors, debug/gosym source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors.
Cite this
iinventedlight. 2026. "Go debug/gosym: read Go symbol and line-number tables." iinventedlight Library, iil:note:943ahhme, version of 2026-11-26. https://iinventedlight.com/library/notes/go-debug-gosym/. License: CC-BY-4.0.
@misc{iil_note_943ahhme,
author = {{iinventedlight}},
title = {{Go debug/gosym: read Go symbol and line-number tables}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-26},
url = {https://iinventedlight.com/library/notes/go-debug-gosym/},
note = {Permanent ID iil:note:943ahhme. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- go-debug-gosym.schema.json (schema; CC-BY-4.0)
- go-debug-gosym.table.json (table; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/go-debug-gosym.md.