dotnet / dotnet/symreader-converter

Rountrip PDBs with missing constant signature

Open
#145 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
C#
Stars
70
Forks
44
PR merge metrics
No merged PRs in 30d

Description

**Repro**

Program.cs:
```C#
using System;

class Program
{
static void Main(string[] args)
{
const float f = 1.0f;
double x = f;
Console.WriteLine(x);
}
}
```

1. `csc Program.cs /debug:portable`
2. `pdb2pdb a.exe`
3. `pdb2pdb a.exe /pdb a.pdb2 /out a.pdb3`
```
PDB0017: token 0x06000001: Invalid local constant data
```

The second step produces a PDB with NIL constant token signature since there is no StandAloneSig in a.exe that matches `float` signature.

The third step then calls ISymUnmanagedConstant.GetSignature on such constant and reports an error.
We could infer the constant signature from the value for primitive types.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.