Skip to content

[Question] Instrumenting inline functions for code coverage #12263

Open
@daveMueller

Description

@daveMueller

Hi,

I'm working on a code coverage tool and we are facing issues when calculating coverage for inline functions.
We instrument the code on IL level and the inline function calls are also instrumented in that way.

The function calls are instrumented properly but due to the fact that the compiler inlines the function body
instead of calling the function, the code is never hit by our coverage tool (because the function is never called).

What we would need is a mapping of the functions sequence points to the location where the function body is inlined.
Thus we could add our intrumentation / tracker to the right location in the assemblies IL.

Any idea how we could do this?

(this is the corresponding issue in our repo: coverlet-coverage/coverlet#1225)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    New

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions