rust-lang / rust-lang/rustc_codegen_cranelift

CodeView debug info support for Windows

Open
#1,287 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-debuginfo O-windows
Dominant language
Rust
Stars
2.1k
Forks
157
Avg merge
1d 19h
Merged PRs (30d)
3

Description

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: https://github.com/bjorn3/rustc_codegen_cranelift/issues/1249#issuecomment-1262034841).

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:

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked Rust Windows debug-info issue and PR, then read LLVM's CodeView material and Microsoft's PDB documentation. Compare the existing debug-info behavior with the Windows requirements; done means cg_clif emits usable Windows debug information, including the variable and type information discussed in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.