# stage2: add the \.debug_line header and associated data types · gitcafe/zig

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

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

Visibility: public

Requested revision: ba6e5cbfd279583dcc724f6a74a5593fa26ad5df

Requested commit: ba6e5cbfd279583dcc724f6a74a5593fa26ad5df

Commit: ba6e5cbfd279583dcc724f6a74a5593fa26ad5df

Tree: 8cf75e04b987873bf82f914eee4c39ef75c3fe3a

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage2: add the .debug_line header and associated data types

 * the .debug_line header is written properly
 * link.File.Elf gains:
   - SrcFn, which is now a field in Module.Fn
   - SrcFile, which is now a field in Module.Scope.File
 * link.File.Elf gets a whole *Package field rather than only
   root_src_dir_path.
 * the fields first_dbg_line_file and last_dbg_line_file tell where the
   Line Number Program begins and ends, which alows moving files when
   the header gets too big, and allows appending files to the end.
 * codegen is passed a buffer for emitting .debug_line
   Line Number Program opcodes for functions.

See #5963

There is some work-in-progress code here, but I need to go make some
experimental changes to changing how to represent source locations and I
want to do that in a separate commit.

```

## Parents

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

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