Skip to content
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

JetBrains dotCover can't read pdb-files produced by Aspect Injector #107

Closed
ESolovova opened this issue Sep 24, 2019 · 7 comments
Closed
Assignees
Labels
Milestone

Comments

@ESolovova
Copy link

dotCover considers pdb-files to be invalid:

Message = Inner scope [IL_0004-IL_005d] is not inside parent Scope(IL_0000-IL_0000, 6000001)
ExceptionPath = Root.InnerException
ClassName = System.ArgumentException
HResult = E_INVALIDARG=COR_E_ARGUMENT=WIN32_ERROR_INVALID_PARAMETER=80070057
Source = JetBrains.Platform.Metadata
StackTraceString = 
  at JetBrains.Metadata.Debug.LocalScope.GetOrCreateInnerScopes(Int32 startOffset, Int32 endOffset, ICollection`1 scopes, ImportScope importScope) in /Product.Root/Platform/Core/Shell/Metadata/Src/Debug/LocalScope.cs:line 155
     at JetBrains.Metadata.Debug.DebugDataExtensions.AddLocalVariables(DebugMethod method, DebugLocalVariable[] localVariables, Int32 scopeStartOffset, Int32 scopeEndOffset, ImportScope importScope) in /Product.Root/Platform/Core/Shell/Metadata/Src/Debug/DebugDataExtensions.cs:line 152
     at JetBrains.Metadata.Debug.DebugDataExtensions.AddLocalVariable(DebugMethod method, Int32 index, String name, LocalVariableAttributes attributes, MetadataToken localSignatureToken, TupleElementNamesData tupleElementNames, Int32 scopeStartOffset, Int32 scopeEndOffset, ImportScope importScope) in /Product.Root/Platform/Core/Shell/Metadata/Src/Debug/DebugDataExtensions.cs:line 142
     at JetBrains.Metadata.Debug.DebugDataExtensions.ProcessScopes(DebugMethod method, PdbScope scope, ImportScope importScope, PdbFunction pdbFunction) in /Product.Root/Platform/Core/Shell/Metadata/Src/Debug/DebugDataExtensions.cs:line 93
     at JetBrains.Metadata.Debug.DebugDataExtensions.CreateMethod(DebugData debugData, PdbFunction pdbFunction) in /Product.Root/Platform/Core/Shell/Metadata/Src/Debug/DebugDataExtensions.cs:line 68
     at JetBrains.Metadata.Debug.Pdb.WindowsPdbFile.GetDebugData(PdbParseLevel level, FileSystemPath originalPdbFilePath) in /Product.Root/Platform/Core/Shell/Metadata/Src/Debug/Pdb/WindowsPdbFile.cs:line 306
     at JetBrains.Metadata.Debug.Pdb.PdbUtils.ToParsedPdb(WindowsPdbFile windowsPdbFile, PdbParseLevel level, DateTime pdbTimestamp) in /Product.Root/Platform/Core/Shell/Metadata/Src/Debug/Pdb/PdbUtils.cs:line 384
     at JetBrains.Metadata.Debug.Pdb.PdbReader.ReadPdb(FileSystemPath pdbPath, PdbParseLevel level, IDebugAssemblyInfo debugAssemblyInfo) in /Product.Root/Platform/Core/Shell/Metadata/Src/Debug/Pdb/PdbReader.cs:line 38

It seems to me that the problem is caused by the FluentIL.MethodEditor.Instead extension which clears method body instructions, but doesn't clear method variables: https://github.com/pamidur/fluent-il/blob/cf245d3e7cb9dab3e72c08b847a7adc5f49d915b/src/FluentIL/MethodEditor.cs#L50

Because of that MonoCecil writes to pdb-files invalid scopes debug info.

@pamidur
Copy link
Owner

pamidur commented Sep 24, 2019

Hi,
Thanks for the report. Look like a bug. Will be fixed.

ps. do you know if there is any lib that I can use to check the validity of pdb at runtime (tests)?

@pamidur pamidur self-assigned this Sep 24, 2019
@pamidur pamidur added the bug label Sep 24, 2019
@pamidur pamidur added this to the 2.3 milestone Sep 24, 2019
@ESolovova
Copy link
Author

ps. do you know if there is any lib that I can use to check the validity of pdb at runtime (tests)?

Unfortunately, no, I don't know, sorry. I use our own JetBrains pdb reader, but it's not public.

@pamidur
Copy link
Owner

pamidur commented Oct 9, 2019

Would you mind to check if v2.2.3 fix the issue, please?

@lanegoolsby
Copy link

It did not

@pamidur
Copy link
Owner

pamidur commented Jul 31, 2020

There were some changes recently, could you please check it against 2.4.1 if this issue is still relevant

@lanegoolsby
Copy link

The issue is not resolved.

@pamidur
Copy link
Owner

pamidur commented Mar 30, 2021

tracked in #150

@pamidur pamidur closed this as completed Mar 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants