-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ilspycmd] Broken PDB generated for MoveNext
when using --genpdb
#2823
Comments
Trying to decompile one of the methods shows private void MoveNext()
{
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
//IL_017c: Unknown result type (might be due to invalid IL or missing references)
//IL_0186: Expected O, but got Unknown
//IL_0181: Unknown result type (might be due to invalid IL or missing references)
//IL_019d: Unknown result type (might be due to invalid IL or missing references)
//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
int num = <>1__state;
... The first block is: IL_004d: callvirt instance valuetype [System.Runtime]System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1<!0> class [System.Runtime]System.Threading.Tasks.Task`1<class Foundation.NSUrlRequest>::ConfigureAwait(bool) /* 0A000BCE */
IL_0052: stloc.s 5
IL_0054: ldloca.s 5
IL_0056: call instance valuetype [System.Runtime]System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1/ConfiguredTaskAwaiter<!0> valuetype [System.Runtime]System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1<class Foundation.NSUrlRequest>::GetAwaiter() /* 0A000BCF */ so maybe it just needs to find |
Nope, that did not help :| |
I tried your tool, but it does not give me the same output on Windows. No errors are reported using it on |
I'm on a Mac computer. Is there Windows (or Mac) specific code paths for PDB ? Anyway I'll be trying your fix once pushed, thanks for looking :) |
It works for me when using the Avalonia version of ILSpy (version 7.2.0.0.rc) on the Mac. So I could be an issue (only) with Did you try using the command tool ? |
I tried ILSpy master and the released version of ilspycmd, that is 7.2.1.6856 (via dotnet tool install). It's interesting that it's the same version that ILSpyAvalonia is using currently: https://github.com/icsharpcode/AvaloniaILSpy/blob/master/ILSpy.Core/ILSpy.Core.csproj#L32 |
…ection of async state-machines involving unknown types.
I have pushed two commits that fix some of the issues I saw. Can you please try again? Thanks! |
In my original report I used the prebuilt tools ( This time I
cp /usr/local/share/dotnet//packs/Microsoft.iOS.Runtime.iossimulator-x86/16.0.523/runtimes/iossimulator-x86/lib/net6.0/* tmp/
This is hitting
If I try the same in a release build (
If I do not specify The build works but the decompiled sources are not visible in the debugger and the Maybe I missing a step somewhere ? |
Ok, so there is multiple issues:
Regarding the differences in file size... I will have to investigate further, but you can always look at the PDB file in ILSpy and check if the |
That makes sense. Thanks for the help! Sadly ILSpy/Avalonia does not show the metadata tables :( but I can check that with some code... or UPS will finally deliver me my volterra devkit and I'll have a window box again (after more than 15 years) |
So after doing a (more proper) I have no error (as expected) but don't get any document (0x30) from the assembly... binaries attached |
I see them on Windows too. I noticed the workload number changed so I might have copied the pdb to the older location... I'll restart this from scratch and compare the results (myself) on Windows. |
Background
The iOS SDK does not use Source Link and also does not embed sources inside PDB (which would be quite useful for the generated code). I thought ILSpy could help :)
Steps to reproduce
Both
and
were tried.
Original files: Microsoft.iOS.zip
Error message shown
Versions
More details
I have hit a few PDB issues in the past so I wrote a tool to see what could be wrong in them (or Cecil).
The output I get is:
Microsoft.iOS
CoreFoundation.CFNetwork/d__15 / System.Void CoreFoundation.CFNetwork/d__15::MoveNext()
System.Net.Http.NSUrlSessionHandler/NSUrlSessionDataTaskStream/d__14 / System.Void System.Net.Http.NSUrlSessionHandler/NSUrlSessionDataTaskStream/d__14::MoveNext()
System.Net.Http.NSUrlSessionHandler/d__57 / System.Void System.Net.Http.NSUrlSessionHandler/d__57::MoveNext()
System.Net.Http.NSUrlSessionHandler/d__58 / System.Void System.Net.Http.NSUrlSessionHandler/d__58::MoveNext()
System.Net.Http.CFContentStream/d__10 / System.Void System.Net.Http.CFContentStream/d__10::MoveNext()
System.Net.Http.CFNetworkHandler/d__19 / System.Void System.Net.Http.CFNetworkHandler/d__19::MoveNext()
System.Net.Http.CFNetworkHandler/d__20 / System.Void System.Net.Http.CFNetworkHandler/d__20::MoveNext()
Compression.CompressionStream/CopyToAsyncStream/d__8 / System.Void Compression.CompressionStream/CopyToAsyncStream/d__8::MoveNext()
Compression.CompressionStream/CopyToAsyncStream/d__9 / System.Void Compression.CompressionStream/CopyToAsyncStream/d__9::MoveNext()
Compression.CompressionStream/d__41 / System.Void Compression.CompressionStream/d__41::MoveNext()
Compression.CompressionStream/d__73 / System.Void Compression.CompressionStream/d__73::MoveNext()
Compression.CompressionStream/d__74 / System.Void Compression.CompressionStream/d__74::MoveNext()
The text was updated successfully, but these errors were encountered: