I did some research on this before asking the question and since I might be asking it incorrectly, I might not have done the right searches here first.
在问这个问题之前我做了一些研究,因为我可能会错误地问它,我可能不会在这里做正确的搜索。
What I am trying to accomplish is when I start to debug or run an application in Visual Studio, is to have the IDE show me what methods are executing when I do something in the GUI/application.
我想要完成的是当我开始在Visual Studio中调试或运行应用程序时,是让IDE向我展示当我在GUI /应用程序中执行某些操作时正在执行的方法。
For instance if I click a button in the GUI labelled "Search", I want to see the chain of events/methods that execute for this process. This I am not sure of. I hope I have asked the question correctly. Thank you for your time.
例如,如果我点击标有“搜索”的GUI中的按钮,我想看到为此过程执行的事件/方法链。我不确定。我希望我已正确地提出这个问题。感谢您的时间。
3 个解决方案
#1
1
Have a try with IntelliTrace.
尝试使用IntelliTrace。
- Make sure IntelliTrace is enabled and call information is selected;
- 确保已启用IntelliTrace并选择了呼叫信息;
- Launch your GUI application, and perform what action you want;
- 启动GUI应用程序,然后执行您想要的操作;
- In IntelliTrace window, click
Break All
. If IntelliTrace window is not displayed, click Debug -> Windows -> IntelliTrace Event; - 在IntelliTrace窗口中,单击“全部中断”。如果未显示IntelliTrace窗口,请单击Debug - > Windows - > IntelliTrace Event;
- Expand the event you are interested, for example, 'Clicked Search', and click
Call View
link; - 展开您感兴趣的活动,例如“Clicked Search”,然后单击“Call View”链接;
- You can see call stack you are interested.
- 你可以看到你感兴趣的调用堆栈。
#2
0
There are two ways to approach this:
有两种方法可以解决这个问题:
-
If you have no idea where the code you are looking for is, then simply start your program with a Profiler such as JetBrains dotTrace. Then, get ready to push the button, click "Start Profiling", click the button, and then as soon as the operation is finished, click "Get Snapshot". Now, use dotTrace's Call Tree to see which methods called which. I use this technique all the time for just this purpose! In this view, you can use the arrows key to navigate the method-calls tree.
如果您不知道您要查找的代码在哪里,那么只需使用JetBrains dotTrace等Profiler启动程序即可。然后,准备好按下按钮,单击“开始分析”,单击按钮,然后在操作完成后立即单击“获取快照”。现在,使用dotTrace的调用树来查看哪些方法称为哪个。我一直用这种技术就是为了这个目的!在此视图中,您可以使用箭头键来导航方法调用树。
-
If you have a general idea of which class[/es] get invoked when you hit the button on the GUI, but don't know exactly which methods are called, you can use OzCode's "Add Breakpoint to Every Method" on a class, so that even if you don't know the exact method that's about to be called, whenever the class is accessed, you'll break into the debugger and be able to explore.
如果您对GUI上的按钮调用哪个类[/ es]有一个大概的了解,但是不确切地知道调用了哪些方法,那么可以在类上使用OzCode的“为每个方法添加断点”,因此,即使您不知道将要调用的确切方法,无论何时访问该类,您都将进入调试器并能够进行探索。
Due Diligence Disclaimer: I am a co-creator of OzCode.
尽职调查免责声明:我是OzCode的共同创建者。
#3
0
You can use the Runtime Flow tool (commercial, developed by me) to see the chain of events/methods in a .NET application for GUI actions.
您可以使用Runtime Flow工具(商业,由我开发)来查看.NET应用程序中用于GUI操作的事件/方法链。
#1
1
Have a try with IntelliTrace.
尝试使用IntelliTrace。
- Make sure IntelliTrace is enabled and call information is selected;
- 确保已启用IntelliTrace并选择了呼叫信息;
- Launch your GUI application, and perform what action you want;
- 启动GUI应用程序,然后执行您想要的操作;
- In IntelliTrace window, click
Break All
. If IntelliTrace window is not displayed, click Debug -> Windows -> IntelliTrace Event; - 在IntelliTrace窗口中,单击“全部中断”。如果未显示IntelliTrace窗口,请单击Debug - > Windows - > IntelliTrace Event;
- Expand the event you are interested, for example, 'Clicked Search', and click
Call View
link; - 展开您感兴趣的活动,例如“Clicked Search”,然后单击“Call View”链接;
- You can see call stack you are interested.
- 你可以看到你感兴趣的调用堆栈。
#2
0
There are two ways to approach this:
有两种方法可以解决这个问题:
-
If you have no idea where the code you are looking for is, then simply start your program with a Profiler such as JetBrains dotTrace. Then, get ready to push the button, click "Start Profiling", click the button, and then as soon as the operation is finished, click "Get Snapshot". Now, use dotTrace's Call Tree to see which methods called which. I use this technique all the time for just this purpose! In this view, you can use the arrows key to navigate the method-calls tree.
如果您不知道您要查找的代码在哪里,那么只需使用JetBrains dotTrace等Profiler启动程序即可。然后,准备好按下按钮,单击“开始分析”,单击按钮,然后在操作完成后立即单击“获取快照”。现在,使用dotTrace的调用树来查看哪些方法称为哪个。我一直用这种技术就是为了这个目的!在此视图中,您可以使用箭头键来导航方法调用树。
-
If you have a general idea of which class[/es] get invoked when you hit the button on the GUI, but don't know exactly which methods are called, you can use OzCode's "Add Breakpoint to Every Method" on a class, so that even if you don't know the exact method that's about to be called, whenever the class is accessed, you'll break into the debugger and be able to explore.
如果您对GUI上的按钮调用哪个类[/ es]有一个大概的了解,但是不确切地知道调用了哪些方法,那么可以在类上使用OzCode的“为每个方法添加断点”,因此,即使您不知道将要调用的确切方法,无论何时访问该类,您都将进入调试器并能够进行探索。
Due Diligence Disclaimer: I am a co-creator of OzCode.
尽职调查免责声明:我是OzCode的共同创建者。
#3
0
You can use the Runtime Flow tool (commercial, developed by me) to see the chain of events/methods in a .NET application for GUI actions.
您可以使用Runtime Flow工具(商业,由我开发)来查看.NET应用程序中用于GUI操作的事件/方法链。