Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

external and compressed debug info #2300

Open
3 tasks
daurnimator opened this issue Apr 18, 2019 · 2 comments
Open
3 tasks

external and compressed debug info #2300

daurnimator opened this issue Apr 18, 2019 · 2 comments
Labels
proposal This issue suggests modifications. If it also has the "accepted" label then it is planned.
Milestone

Comments

@daurnimator
Copy link
Contributor

daurnimator commented Apr 18, 2019

There are a couple of object sections I'd like to be able to use when creating applications/libraries in zig.

.gnu_debuglink

From https://sourceware.org/binutils/docs/binutils/objcopy.html:

Part of the process of adding the .gnu_debuglink section involves embedding a checksum of the contents of the debug info file into the section.

From https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html#Separate-Debug-Files

A debug link is a special section of the executable file named .gnu_debuglink. The section must contain:

  • A filename, with any leading directory components removed, followed by a zero byte,
  • zero to three bytes of padding, as needed to reach the next four-byte boundary within the section, and
  • a four-byte CRC checksum, stored in the same endianness used for the executable file itself. The checksum is computed on the debugging information file’s full contents by the function given below, passing zero as the crc argument.

Any executable file format can carry a debug link, as long as it can contain a section named .gnu_debuglink with the contents described above.

.gnu_debugdata

From https://sourceware.org/gdb/onlinedocs/gdb/MiniDebugInfo.html:

.gnu_debugdata section. This feature is called MiniDebugInfo. This section holds an LZMA-compressed object and is used to supply extra symbols for backtraces.

Related to #2851

@andrewrk andrewrk added this to the 0.6.0 milestone Apr 18, 2019
@andrewrk andrewrk added the proposal This issue suggests modifications. If it also has the "accepted" label then it is planned. label Apr 18, 2019
@andrewrk
Copy link
Member

Thanks for the filing the issue. Do you know if clang supports these?

@daurnimator
Copy link
Contributor Author

Do you know if clang supports these?

clang doesn't need to, it's a feature of:

  • debuggers (or anything that generates backtraces)
  • objcopy
  • build tooling

@andrewrk andrewrk modified the milestones: 0.6.0, 0.7.0 Feb 10, 2020
@andrewrk andrewrk modified the milestones: 0.7.0, 0.8.0 Oct 27, 2020
@andrewrk andrewrk modified the milestones: 0.8.0, 0.9.0 May 19, 2021
@andrewrk andrewrk modified the milestones: 0.9.0, 0.10.0 Nov 23, 2021
@andrewrk andrewrk modified the milestones: 0.10.0, 0.11.0 Apr 16, 2022
@andrewrk andrewrk modified the milestones: 0.11.0, 0.12.0 Apr 9, 2023
@andrewrk andrewrk modified the milestones: 0.13.0, 0.12.0 Jul 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal This issue suggests modifications. If it also has the "accepted" label then it is planned.
Projects
None yet
Development

No branches or pull requests

2 participants