Skip to content

Emit windows-specific debug info #19533

Closed
@brson

Description

@brson
Contributor

LLVM supports a simple windows-specific debug info containing just line numbers, that works correctly in the MS debugger. @michaelwoerister knows the details.

Activity

added
A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)
on Dec 4, 2014
michaelwoerister

michaelwoerister commented on Dec 5, 2014

@michaelwoerister
Member

The relevant information can be found at http://clang.llvm.org/docs/MSVCCompatibility.html:

Clang emits both CodeView line tables (similar to what MSVC emits when given the /Z7 flag) and DWARF debug information into the object file. Microsoft’s link.exe will transform the CodeView line tables into a PDB, enabling stack traces in all modern Windows debuggers. Clang does not emit any CodeView-compatible type info or description of variable layout.

We should try and support this functionality also in rustc.

retep998

retep998 commented on Dec 30, 2014

@retep998
Member

This depends on adding support for rustc using link.exe.

michaelwoerister

michaelwoerister commented on Dec 30, 2014

@michaelwoerister
Member

Yes, if you don't want to do your linking manually. I agree that if we say that we support this type of debuginfo, we should also make it as ergonomic as possible.

Manishearth

Manishearth commented on Feb 23, 2015

@Manishearth
Member
alexcrichton

alexcrichton commented on May 27, 2015

@alexcrichton
Member

Assigning to @michaelwoerister, this is coming more relevant now that we have initial MSVC support!

jrmuizel

jrmuizel commented on May 28, 2015

@jrmuizel
Contributor

FWIW, I have the beginnings of a LLVM patch for adding x86-32 FPO information for unwinding.

michaelwoerister

michaelwoerister commented on Jun 25, 2015

@michaelwoerister
Member

Quick update: It seems that LLVM on Windows will already emit CodeView line tables alongside DWARF if debuginfo is enabled. We just have to instruct link.exe to convert these into a PDB file, using the /DEBUG option. In a minimal proof of concept I was able to compile a small Rust program and step through it using WinDbg.

Manishearth

Manishearth commented on Jun 26, 2015

@Manishearth
Member

Would this solve the problem? Or will we still need to rig something up for printing local vars &c?

6 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)O-windowsOperating system: Windows

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @sanxiyn@alexcrichton@brson@jrmuizel@retep998

      Issue actions

        Emit windows-specific debug info · Issue #19533 · rust-lang/rust