Skip to content

A playground for dealing with call stack and assembly metadata

Notifications You must be signed in to change notification settings

oleg-shilo/Stack-Analyser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Stack-Analyser

A playground for dealing with call stack and assembly metadata

The typical challenge of working with StackTrace is the difficulties of resolving local variables names. This is due to the fact the the variable names are not stored in the stack and but their indexes only. Thus index is the variable identity.

This solution shows how to read the missing info (variable names) from teh metadata:

class Program
{
    static void Main()
    {
        method2();
    }

    static void method1()
    {
        var testVar1 = "asdASDAS"; Inspect();
    }

    static void method2()
    {
        var testVar2 = "ccccccccccccc";
        var testVar3 = "ccccccccccccc"; Inspect();

        for (int i = 0; i < 2; i++)
        {
            var testVar4 = "ccccccccccccc";
            var testVar5 = "ccccccccccccc";
        }
        method1();
    }
}

image

About

A playground for dealing with call stack and assembly metadata

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages