Visual Studio Watch window greyed out?

后端 未结 5 694
北荒
北荒 2021-02-14 13:21

I have a VB app that I need to monitor while it is running. I added some variables to the Watch window, but while the app is running the watch window is greyed out. The only w

相关标签:
5条回答
  • 2021-02-14 13:50

    Make sure you are in "Debug" build and Microsoft Debugger is running as a service and not blocked/disabled.

    0 讨论(0)
  • 2021-02-14 13:50

    This should help you: How to trace and debug in Visual C++ .NET and in Visual C++ 2005

    0 讨论(0)
  • 2021-02-14 14:04

    After you've done "break" to give control of the program to the debugger, then you can "step" through the code using function keys like F10 and F11. During each 'step', the program evaluates one or more statements; after each step it stops (until the next step), and while (only while) it's stopped you can 'watch' its current state.

    There are other ways too to break into the debugger (to use the Watch window while the program is stopped): other ways like to set 'breakpoints', and use the 'run to cursor' feature.


    Of course, but stopping a program that is actively receiving or sending data to a some other process, driver, etc, stops this communication and causes timeouts and other problems.

    That's true. To watch values change in real-time, I use a log file:

    • Add statements to my code, such that when I change the value of a variable I emit a new line to a log file (showing the changed value)

    • Run the program

    • Watch new lines being appended to the log file using a utility like tail -f.

    I've never see a debugger with the functionality you mention. The closest thing to the functionality you mentioned (and which isn't exactly the functionality you mentioned) is How to: Set a Data Breakpoint (Native Only).

    0 讨论(0)
  • 2021-02-14 14:10

    What you're attempting to do is not possible in Visual Studio. All of the variable inspection windows (watch, locals, autos, etc ...) rely on the debugee process being in a break state in order to function.

    This is true of essentially any debugger I've worked with in the past. At least those which use a compiled language.

    I'm curious as to what IDE's you're referring to? Did they deal with interpreted languages?

    0 讨论(0)
  • 2021-02-14 14:13

    Which IDE or development environment shows - in real time - the values of variables in the Watch window, without having to hit any breakpoints, while the application is running?

    Visual Studio doesn't provide this. In order to get updated values in the Watch window, or edit items there, the app needs to be at a breakpoint or debugging.

    0 讨论(0)
提交回复
热议问题