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

CodeView debug info support for Windows #1287

Open
afonso360 opened this issue Sep 29, 2022 · 1 comment
Open

CodeView debug info support for Windows #1287

afonso360 opened this issue Sep 29, 2022 · 1 comment
Labels
A-debuginfo Area: Debugging information at runtime in generated code. O-windows Operating system: Windows

Comments

@afonso360
Copy link
Contributor

afonso360 commented Sep 29, 2022

It looks like cg_clif doesn't support debug info on Windows. It would be nice if we could do that!

Some pdb files are generated but I'm not sure what's in them (see: #1249 (comment)).

I've been looking into this mostly because I have no idea how any of this works. I found two crates that seem to produce pdb files (bao-pdb, pdb_wrapper), but I'm not sure how complete they are or if they work for our use case.

A more interesting approach is what LLVM does for generating CodeView. LLVM apparently only emits CodeView line tables, and DWARF debug info (which we already know how to do!) And lets link.exe convert it into a PDB file, this seems like a much easier solution and maybe implementing only that part of CodeView would be easier.

Edit: Re-reading the rust issue, it looks like this doesn't get us variable and type information, only line information.

Edit 2: That information is also out of date, LLVM now has full CodeView support, but its good to know that that's how they started out.

Additional links:

@bjorn3 bjorn3 added A-debuginfo Area: Debugging information at runtime in generated code. O-windows Operating system: Windows labels Sep 29, 2022
@bjorn3
Copy link
Member

bjorn3 commented Sep 29, 2022

I found two crates that seem to produce pdb files (bao-pdb, pdb_wrapper), but I'm not sure how complete they are or if they work for our use case.

They are both licensed under Unlicense and from the same author. I'm not sure if Unlicense is allowed.

Edit: Re-reading the rust issue, it looks like this rust-lang/rust#19533 (comment), only line information.

cg_clif already only supports line information anyway. I couldn't quite get the Cranelift integration for value tracking working reliably last time I tried.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debuginfo Area: Debugging information at runtime in generated code. O-windows Operating system: Windows
Projects
None yet
Development

No branches or pull requests

2 participants