Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find out what line of code my app is currently running in Visual Studio's debug mode

When I'm running an app in debug mode with Visual Studio, is there a way that I can find out what line of code is currently being processed? By this I mean, is there a tool that works kind of like setting a breakpoint, but you don't have to set a breakpoint - you can just find out at any point in time what line of code is being executed?

The reason for this, is that sometimes you may want to debug intermittent hangs in your app. If your running in debug mode, and your app hangs, it would be useful to immediately find out what line of code it last processed, without having to plan ahead by setting breakpoints or trace calls.

like image 958
cbp Avatar asked May 09 '12 01:05

cbp


People also ask

How do I view line by code in Visual Studio?

Click the Debug | Step Into menu item or press the F11 key to step into any property or method for debugging. You can then continue the line by line execution by pressing F10 or continue ...

How do I view line by code?

You can step through the code in a number of different methods, you can step through line by line using F11, step over using F10 or step out using (Shift+F11). Step Through: Each and every line of code executed will be debugged.

How do you run code in debug mode in VS Code?

To run or debug a simple app in VS Code, select Run and Debug on the Debug start view or press F5 and VS Code will try to run your currently active file. However, for most debugging scenarios, creating a launch configuration file is beneficial because it allows you to configure and save debugging setup details.

How can I see Debug logs in VS Code?

You can find other debug logs you've downloaded with Visual Studio Code in the . sfdx/tools/debug/logs folder. Right-click any line in the debug log, then choose SFDX: Launch Apex Replay Debugger with Current File.


1 Answers

Press the Pause Button ("||").

like image 128
RBarryYoung Avatar answered Sep 21 '22 10:09

RBarryYoung