Skip to content
This repository was archived by the owner on Nov 13, 2026. It is now read-only.

Refactor debug info handling - #1270

Merged
MichalStrehovsky merged 3 commits into
dotnet:masterfrom
MichalStrehovsky:debuginfo
May 13, 2016
Merged

MichalStrehovsky merged 3 commits into
dotnet:masterfrom
MichalStrehovsky:debuginfo

Conversation

@MichalStrehovsky

Copy link
Copy Markdown
Member

I figured I should probably push this out early so I can get feedback before I continue.

Debug info retrieval is currently strongly tied to the ECMA format. I'm proposing we abstract it out into a GetDebugInfo method on MethodIL that returns the debug information wrapped in a MethodDebugInformation subclass.

The proposed next steps are this:

  • Implement EcmaMethodDebugInformation that will do what CompilerTypeSystemContext currently does to implement the symbol handling.
  • Take out PDB reader creation and move it to EcmaModule.Symbols.cs. EcmaModule will directly expose a property to get to it's PDB/PortablePDB reader. EcmaMethodDebugInformation will use it in it's implementation.
  • Move files from src\Compiler\SymbolReader to Common\TypeSystem\Ecma\SymbolReader and reference them from the ILCompiler.TypeSystem project.
  • Expose a method on Compilation.cs to get to the MethodDebugInformation of a MethodIL. This is to potentially allow hijacking empty MethodDebugInformation and generating a new one that refers to an on-the-fly generated IL file.

@jkotas

jkotas commented May 11, 2016

Copy link
Copy Markdown
Member

👍 so far...

private IEnumerable<string> GetParameterNamesForMethod(MethodDesc method)
{
// TODO: The uses of this method need revision. The right way to get to this info is from
// a MethodIL. For declarations, we don't need names.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part makes me particularly unhappy, but it wasn't immediately clear why the code path that ends up needing parameter names is called from half a dozen places within CppCodegen. I'm not sure this will play well with the various strategies where a body of a MethodDesc is replaced with a body of a different MethodDesc, unless we want to enforce the parameter names match so that CppCodegen won't notice.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(At this point I'm considering taking parameter names handling out of MethodDebugInformation and making it a completely separate beast, but I was hoping I could abstract this weirdness out. By weirdness I mean storing some of the symbolic information within the runtime image, and some in the PDB.)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think having the parameter names in MethodDebugInformation is good.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW: The new portable PDBs use the same format as ECMA metadata. The portable PDBs are conceptually just a few more metadata tables. I believe there is an option to store everything in the same file (though it is unlikely to be used much anytime soon because of none of the tooling understands it).

@jkotas

jkotas commented May 12, 2016

Copy link
Copy Markdown
Member

LGTM

@MichalStrehovsky MichalStrehovsky changed the title [WIP] Refactor debug info handling Refactor debug info handling May 13, 2016
@MichalStrehovsky
MichalStrehovsky merged commit 4cc461b into dotnet:master May 13, 2016
@MichalStrehovsky
MichalStrehovsky deleted the debuginfo branch May 13, 2016 00:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants