JasonBock / SpackleNet

Spackle is a project that contains a number of helper methods I've used to supplement the core classes in .NET.
MIT License
14 stars 1 forks source link

Package in Debugger Has Issues With Values #26

Closed JasonBock closed 4 years ago

JasonBock commented 4 years ago

If I debug this code where it's reference Spackle as a package:

var range = 1..50000;
var partitions = range.Partition(7);
Console.Out.WriteLine(partitions.Length);

foreach(var partition in partitions)
{
    Console.Out.WriteLine($"{partition}\t\t{partition.End.Value - partition.Start.Value}");
}

When I step into Partition(), I get the code in the debugger as expected, but...the local values seem "off": image

richlander commented 4 years ago

I see the same thing, although my experience is slightly worse. I don't get an instruction pointer (the yellow arrow) and it is getting confused on whether RangeExtensions.cs is loaded or not.

I'll ask for some help.

image

richlander commented 4 years ago

Not likely it, but when you build this library, is your working tree clean? If you type git status before you build, you should see: nothing to commit, working tree clean.

JasonBock commented 4 years ago

@richlander I looked, and right now git status is giving what you expected it would. But, I don't remember if I built the .nupkg and .snupkg with everything committed as expected. I'll try making a new version and ensure the status of the repo is good.

JasonBock commented 4 years ago

@richlander I pushed a 9.1.5 version, making sure the repo was in the expected status when I built it, and I'm still seeing the issue :(

tommcdon commented 4 years ago

@JasonBock please try enabling "Suppress JIT optimizations on module load (Managed only)" under Debug->Options

image

JasonBock commented 4 years ago

That seems to have done the trick :)

One thing....I would've never figured this out myself. It may be worth updating any related docs on this topic to enable this setting (or it may already exist and I missed it).