1

Similar questions: One, Two. But this is not what I am looking for.

Similar questions, but said options are diabled: Three, Four, Five.

Situation: I want to identify the line where the value of the variable ApplianceState changes to the value normal. ApplianceState is an enum type and can have one of 4 different values. The project I am working on is quite huge and looking for it line-by-line could take days.

Question: Is there a way I can set a watch so that visual studio breaks at the line where the value of ApplianceState changes to normal?

I know I can set a conditional breakpoint, but that would mean I have to set a break point on certain line, and I don't want to do that.

Also, I have enabled native code debugging and the menu item New Data Breakpoint, in menu Debug -> New Breakpoint, is disabled (greyed out). So, I can't select it.

Community
  • 1
  • 1
ctrl-shift-esc
  • 876
  • 1
  • 9
  • 19
  • to set a data-breakpoint (eg. answer to #3), you need to be stopped in the debugger already, you cannot do it while the program is running. – MuertoExcobito Jan 30 '17 at 04:23
  • @MuertoExcobito The debugger is stopped. I have tried that while the program is running, paused for debugging, compile time and during editing. It is never enabled. – ctrl-shift-esc Jan 30 '17 at 05:30
  • @ctrl-shift-esc, Which kind of app did you really debug? It just supports the VC++/C app: https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/6097301-support-data-breakpoints-for-c, and then you could add it just the breakpoint was hit. For the C# app or others, it doesn't support it. You could create a default Win32 console app, check the result. – Jack Zhai Jan 30 '17 at 06:00
  • @JackZhai-MSFT This is humongous application. The final code is deployed on to household electronic devices. It is not just a VC++ project. It is a C project run in Visual Studio. This C code is run in a simulation (which is in C#, I think), and then burnt on to the chipsets of devices. – ctrl-shift-esc Jan 30 '17 at 06:12
  • @ctrl-shift-esc, If a simple C or VC++ app developed in the VS IDE works well, but this app doesn't work, I feel that it doesn't support feature "Set a Data Breakpoint (Native Only)", the breakpoint was hit during debugging, am I right? – Jack Zhai Jan 30 '17 at 07:17
  • @JackZhai-MSFT Normal breakpoints are hit. Conditional breakpoints are hit. I just can't "set a data breakpoint". I don't think this big project is "native only", as I think it runs on the "simulation". – ctrl-shift-esc Jan 30 '17 at 07:26
  • I agree with you, ctrl-shift-esc. I think this specific project doesn't support this feature. – Jack Zhai Jan 31 '17 at 06:00

0 Answers0