[pdb2mdb] Detect portable PDB and fail gracefully instead of crashing (#4261)
commitec0d74690d45d0bc8c4be2d914755b4ce8c487d8
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Wed, 18 Jan 2017 15:48:07 +0000 (18 16:48 +0100)
committerGitHub <noreply@github.com>
Wed, 18 Jan 2017 15:48:07 +0000 (18 16:48 +0100)
tree980ebd42a5a02234f17d197531f9204feaa34954
parente4b93cd0bdd10a93ab672f7b9568022cfc747720
[pdb2mdb] Detect portable PDB and fail gracefully instead of crashing (#4261)

Before when trying to convert an assembly that had a portable PDB
instead of a native PDB alongside it we'd just crash in the
Microsoft.Cci pdb reader.

We now check whether the symbol file is a portable PDB and exit
gracefully with an error message and exit code 2 from the app.

Users which access the Converter class (like e.g. Xamarin Android [1])
directly can now catch the PortablePdbNotSupportedException to
do custom logic.

[1] https://github.com/xamarin/xamarin-android/blob/15f7547fa673e02256a75910c60c5e13eb158d2b/src/Xamarin.Android.Build.Tasks/Tasks/ConvertDebuggingFiles.cs#L28
mcs/tools/pdb2mdb/Driver.cs