You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I was thinking if it is possible to create an app that uses dnlib to visualize and render the code execution path as a canvas. let me explain a little more.
let say we have a .net GUI application, like a WPF app. lets say it is simple as 3 button, as usual each button have a calling method on click event. each method initiates a new instance of a class. this is sample:
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Btn1_Click(object sender, RoutedEventArgs e)
{
var obj = new Class1();
obj.DoSomething();
}
private void Btn2_Click(object sender, RoutedEventArgs e)
{
var obj = new Class2();
obj.DoSomething();
}
private void Btn3_Click(object sender, RoutedEventArgs e)
{
var obj = new Class2();
obj.DoSomething();
}
public class Class1
{
public void DoSomething()
{
}
}
public class Class2
{
public void DoSomething()
{
}
}
public class Class3
{
public void DoSomething()
{
}
}
}
So far we haveat least 4 classes in the assembly, MainWindow, Class1, Class2, Class3. and probably other ones like App, right?
I would like to generate a graph, which the nodes are methods of objects. this would not be hard at all, maybe end up with something like this:
this would not be hard, i think i can simply list the types in the assembly, foreach type, get property and methods and draw such a graph.
My problem is i would like to visualize the code flow on this graph. for example when user clicks the Button1, then MainWindow.Btn1_Click() is called and then Class1.DoSomething() is calles after. I would like to visualize this flow on the diagram, for example highlight nodes into red like this:
Do you guys have any idea on how i could trace the execution stack and find which nodes i have to turn to red?
FYI a similar application is done in, VS Enterprise edition while debugging (take a look at here),
but i would like to make it as a separated application, which do get assemblies instead of code. Any hint would be appreciated. specially on how to have stack information in realtime and track its changes on runtime...
Thanks
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I was thinking if it is possible to create an app that uses dnlib to visualize and render the code execution path as a canvas. let me explain a little more.
let say we have a .net GUI application, like a WPF app. lets say it is simple as 3 button, as usual each button have a calling method on click event. each method initiates a new instance of a class. this is sample:
and the code behind XAML:
So far we haveat least 4 classes in the assembly, MainWindow, Class1, Class2, Class3. and probably other ones like App, right?
I would like to generate a graph, which the nodes are methods of objects. this would not be hard at all, maybe end up with something like this:
this would not be hard, i think i can simply list the types in the assembly, foreach type, get property and methods and draw such a graph.
My problem is i would like to visualize the code flow on this graph. for example when user clicks the
Button1
, thenMainWindow.Btn1_Click()
is called and thenClass1.DoSomething()
is calles after. I would like to visualize this flow on the diagram, for example highlight nodes into red like this:Do you guys have any idea on how i could trace the execution stack and find which nodes i have to turn to red?
FYI a similar application is done in, VS Enterprise edition while debugging (take a look at here),
but i would like to make it as a separated application, which do get assemblies instead of code. Any hint would be appreciated. specially on how to have stack information in realtime and track its changes on runtime...
Thanks
Beta Was this translation helpful? Give feedback.
All reactions