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

Alternatives to generate debug information for c/cpp/rust #27

Open
snehasish opened this issue Oct 13, 2023 · 1 comment
Open

Alternatives to generate debug information for c/cpp/rust #27

snehasish opened this issue Oct 13, 2023 · 1 comment

Comments

@snehasish
Copy link

I came across the symbolization support page for cpp and the steps documented to add debug information. There are a couple of options in clang and gcc which can be more effective.

  1. The -g (equivalent to -g2) flag generates a lot of debug information, most of which is unnecessary for symbolization. You can reduce the amount of debug information to only line tables by using -gmlt or -g1.

  2. The -gsplit-dwarf flag can generate debug information in a separate file. This helps reduce memory (and time) when linking large binaries with debug information in them. The debug information for each object file is placed in a .dwo file which can then be linked together to a single .dwp file. I believe this will save the objcopy steps.

Have you considered using these options?

@brancz
Copy link
Member

brancz commented Oct 13, 2023

Great questions!

The -g (equivalent to -g2) flag generates a lot of debug information, most of which is unnecessary for symbolization. You can reduce the amount of debug information to only line tables by using -gmlt or -g1.

Absolutely, line tables are sufficient for our purposes. I'll make sure we adapt the docs here!

The -gsplit-dwarf flag can generate debug information in a separate file. This helps reduce memory (and time) when linking large binaries with debug information in them. The debug information for each object file is placed in a .dwo file which can then be linked together to a single .dwp file. I believe this will save the objcopy steps.

At the moment we don't support dwarf packages, but we definitely want to!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants