# link/MachO: fixes to debug symbols · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/edab03bc22018fa66125ecff4d22d09770852a8e)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: edab03bc22018fa66125ecff4d22d09770852a8e

Requested commit: edab03bc22018fa66125ecff4d22d09770852a8e

Commit: edab03bc22018fa66125ecff4d22d09770852a8e

Tree: 477c454f4152e06787a1524f2c07589461eeba07

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
link/MachO: fixes to debug symbols

commitDeclDebugInfo: stop trying to write length 0 debug info - avoids
hitting an error where zig tries to move the debug info section
unnecessarily, gets confused, and reports `error.InputOutput`.

The 2 pieces of code that looked at the source and tried to compute
source line offsets is now improved to match link/Elf - use the
line/column data stored in the Decl object to skip the costly scanning
of source bytes. No need to load Zig source code, AST, or tokens, when
we have the ZIR!

```

## Parents

- [78632894dabec3c20ee2ff4348e03cfa565477ef](https://git.cafe/gitcafe/zig/commit/78632894dabec3c20ee2ff4348e03cfa565477ef?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/edab03bc22018fa66125ecff4d22d09770852a8e?format=markdown)
