Closed
Description
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
- Create a simple Rust program with a structure definition
rusttest::MyType
located inmain.rs
- Dump PDB data using
llvm-pdbutil.exe dump -all main.pdb > main.pdb.txt
command - 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'