views:

37

answers:

1

Somewhere in C++ era i have crafted a library, which enabled string representation of the computation history. Having a math expression like:

TScalar Compute(TScalar a, TScalar b, TScalar c)
{
 return ( a + b ) * c;
}

I could render it's string representation:

r = Compute(VerbalScalar("a", 1), VerbalScalar("b", 2), VerbalScalar("c", 3));
Assert.AreEqual(9, r.Value);
Assert.AreEqual("(a+b)*c==(1+2)*3", r.History );

C++ operator overloading allowed for substitution of a simple type with a complex self-tracking entity with an internal tree representation of everything happening with the objects.

Now i would like to have the same possibility for NET strings, only instead of variable names i would like to see a stack traces of all the places in code which affected a string.

And i want it to work with existing code, and existing compiled assemblies.

Also i want all this to hook into visual studio debugger, so i could set a breakpoint, and see everything that happened with a string.

Which technology would allow this kind of things?

I know it sound like an utopia, but I think visual studio code coverage tools actually do the same kind of job while instrumenting the assemblies.

+1  A: 

Well, there are multiple technologies that could benefit here.

One is build your own logging system to keep track of the info you seek. This list of information could be passed through each computational function or a "class scope" variable could contain the information. This is a more do it yourself approach. Its not low level.

If you want to dig down really deep into the string class, there is a way to reflector the string functions. This reflector system claims it can link up with a debugging system (though I have not tried this). You can try using TestDriven.NET and .NET Reflector. Also if you are using Visual Studio 2008+ Professional or higher you should be able to debug directly into the .NET framework itself. This would allow you to see what is happening to the strings.

If I misunderstand the question or the info you are looking please let me know. I will try to assist in any way that I can.

Jimmie Clark