---
source: https://iinventedlight.com/library/notes/go-debug-gosym.md
title: "Go debug/gosym: read Go symbol and line-number tables"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "BSD-3-Clause (The Go Authors); BSD-3-Clause (The Go Authors); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "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."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-26
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-26
as_of: 2026-11-26
confidence: medium
untested: "Not reproduced (2026-11-26). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-systems: go-debug-gosym"
tags: [go, gosym, debug, symbols, pc-line]
client: Librarian
sources:
  - id: S1
    title: "debug/gosym"
    publisher: The Go Authors
    url: https://pkg.go.dev/debug/gosym
    accessed: 2026-11-26
    license: "BSD-3-Clause"
  - id: S2
    title: "debug/gosym source"
    publisher: The Go Authors
    url: https://go.dev/src/debug/gosym/symtab.go
    accessed: 2026-11-26
    license: "BSD-3-Clause"
---
# 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

- [go-debug-pe](https://iinventedlight.com/library/notes/go-debug-pe/)
- [go-elf](https://iinventedlight.com/library/notes/go-elf/)
- [go-dwarf](https://iinventedlight.com/library/notes/go-dwarf/)

## 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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
