Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Debugging/instrumentation seems incompatible with new compiler output from VS 2015 RTM, no locals?
lassevk
#1 Posted : Wednesday, July 22, 2015 11:15:30 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/14/2011(UTC)
Posts: 9
Location: Porsgrunn, Telemark, Norway

Was thanked: 1 time(s) in 1 post(s)
When I managed to get my class library running under NCrunch earlier I had a test failure and right-clicked a line in the class that was under test and opted to break into the first failing test on that line.

There were no named locals in the locals pane of Visual Studio, hovering over variables didn't work, quickwatch/quick evaluate did not work.

Could it be that compiler output has changed so that the instrumentation engine that handles code coverage and timing is no longer entirely compatible with it?
Remco
#2 Posted : Wednesday, July 22, 2015 11:26:51 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Hi,

Thanks for sharing this issue.

I've just given VS2015 RTM a quick test with a basic method, evaluating locals under NCrunch. In the simplest case, all seems to be in order.

I think there may be something unique about the method you are examining that is surfacing this issue. Is it using the yield or async keywords? Is there much complexity inside the method?

There is the possibility that the debug metadata has changed in the RTM release of VS2015. It changed several times throughout the development of VS2015, so I certainly wouldn't rule this out - but we won't know for sure until we can create a method that consistently reproduces the issue.
lassevk
#3 Posted : Wednesday, July 22, 2015 11:33:07 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 5/14/2011(UTC)
Posts: 9
Location: Porsgrunn, Telemark, Norway

Was thanked: 1 time(s) in 1 post(s)
I can help with that.

Clone/download this project:

https://github.com/lassevk/DiffLib

changeset 026ab3773fe473adaa8339b29fb786aef3aeabcf

Go to the Diff.cs file, line 74 (int matchStart = ...). Right-click the indicator for this line (after NCrunch has warmed up) then pick "Break into first covering test".

I have the following locals:

this
slice1
slice2
(11 unnamed ones of bool and int types)
instrumentationExistingCoverageMarkedIndex
instrumentationExistingTickCount
instrumentationReturnValue
Type Variables -> T

There should be a lot of locals in that method, like matchStart, subslice1, subslice2, matchEnd, but they all seems to be missing. Note that subslice1 and subslice2 are of type Slice<char>, so they are not in the unnamed ones either.
Remco
#4 Posted : Wednesday, July 22, 2015 11:48:44 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Thanks, this really helps a whole lot.

I'll need to look into this in more detail before I understand exactly what's happening, but looking at the complexity of the method involved, I'd say there's a high chance that the Roslyn compiler is emitting debug metadata that NCrunch is not interpreting or handling correctly.

I'll let you know when I have more information.
Remco
#5 Posted : Friday, July 24, 2015 6:14:27 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,144

Thanks: 959 times
Was thanked: 1290 time(s) in 1196 post(s)
Sorry, it doesn't look like I will be able to provide you with a fix for this issue in the short term.

On close analysis of the method, there does not appear to be any debug metadata being misinterpreted by NCrunch. Somehow, the variables are being swallowed. I've had no luck in reproducing the problem outside the method that you've provided.

I recommend breaking the method down in order to reduce its complexity - this may help with the debug resolution. I will continue trying to understand why this is behaving the way it is. I do not think this is a new problem introduced by VS2015 RTM - it's likely been there for a while.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.035 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download