Skip to content

Missing debug information about type definitions in PDB #98678

Closed
@artemmukhin

Description

@artemmukhin

It seems like rustc does not generate enough information about types in PDB debug information. Particularly, the PDB IPI Stream contains invalid LF_UDT_MOD_SRC_LINE entries without source file information. Due to this issue, from the debugger's perspective, it is impossible to check whether a certain type corresponds to Rust source code or not. This affects both user-defined and stdlib types.

Steps to reproduce

  1. Create a simple Rust program with a structure definition rusttest::MyType located in main.rs
  2. Dump PDB data using llvm-pdbutil.exe dump -all main.pdb > main.pdb.txt command
  3. Look at rusttest::MyType information in the TPI Stream and IPI Stream sections

It may look as follows:

                     Types (TPI Stream)                     
============================================================
  0x107A | LF_STRUCTURE [size = 76, hash = 0x2C45E] `rusttest::MyType`
           unique name: `36f9e7b2e2f4a0c8d5bebaa1feba526d`
           vtable: <no type>, base list: <no type>, field list: 0x1079
           options: has unique name, sizeof 8

                     Types (IPI Stream)                     
============================================================
   0x1051 | LF_UDT_MOD_SRC_LINE [size = 20, hash = 0x1C61]
            udt = 0x107A, mod = 4, file = 1, line = 0

                        String Table                        
============================================================
     ID | String
      1 | '\<unknown>'

Note, in the corresponding entry of IPI Stream (udt = 0x107A) we have file = 1, which refers to an unknown file.

In comparison, this is an example of correct information generated by cl.exe when compiling a similar C++ program:

                     Types (TPI Stream)                     
============================================================
   0x5760 | LF_STRUCTURE [size = 44, hash = 0x1D1EA] `MyType`
            unique name: `.?AUMyType@@`
            vtable: <no type>, base list: <no type>, field list: 0x575F
            options: has unique name, sizeof 4

                     Types (IPI Stream)                     
============================================================
   0x287E | LF_UDT_MOD_SRC_LINE [size = 18, hash = 0x5B53]
            udt = 0x5760, mod = 1, file = 19765, line = 3

                        String Table                        
============================================================
   19765 | 'C:\path\to\main.cpp'

Metadata

Metadata

Assignees

Labels

A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)C-bugCategory: This is a bug.O-windows-msvcToolchain: MSVC, Operating system: WindowsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions