microsoft / microsoft/CLRInstrumentationEngine

Api for getting original instruction size

Open
#288 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

api change
Dominant language
C++
Stars
102
Forks
52
Avg merge
13h 11m
Merged PRs (30d)
6

Description

Instrumentation alters the original instruction graph (such as expanding all branches/switches to all forms). This can make it challenging to correlate instructions with pdb data, which requires IL offset and length.

IInstruction has GetOriginalOffset which helps, but no way of getting the original size. Some possible fixes:

  • Add a GetOriginalCodeSize api on MethodInfo. This can be used, along with GetOriginalOffset to figure out the original instruction sizes.
  • Expose a GetOriginalInstructionLength on each instruction.

The current workaround is to fallback to ICorProfilerInfo.GetILFunctionBody to retrieve the original CodeSize from the method header.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the IInstruction.GetOriginalOffset API, MethodInfo, and the ICorProfilerInfo.GetILFunctionBody workaround described in the issue. Decide which proposed API can expose the original code size or instruction length, then verify that it lets callers correlate transformed instructions with the original IL offset and length.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.