none
Debugging in VS 2017 Community Edition RRS feed

  • Question

  • I need to debug a program. It compiled and I ran it OK. I wander how I can define a breakpoint on specific lines in the source code (C++). In the drop down menu there are two items: Function Breakpoint and code breakpoint. The code breakpoint is dimmed. Functional Breakpoint is too clumsy to be useful. How can I un-dimm the code breakpoint?

    What does it mean: "Enable Just My Code?"

    Thanks, - MyCatAlex

    • Edited by MyCatAlex Saturday, August 26, 2017 12:00 AM
    Friday, August 25, 2017 11:52 PM

Answers

  • While viewing/editing the source file, left click in the margin to the left of the statement that you want to stop at.  This will insert a breakpoint just prior to the execution of that statement.  The presence of the breakpoint is confirmed by a red circle in the margin at that point.
    • Marked as answer by MyCatAlex Saturday, August 26, 2017 1:51 PM
    Saturday, August 26, 2017 12:11 AM
  • My old friend @RLWA32! Thank you for showing up. I always press F11 which is step over but I end up in Assembly code anyway. Then I press F5 and jump out of there. I am making some progress but what a difference from Linux!

    +  &messages 0x0000001ef12fed90 {msg=0x0000031f wp=0x0000000000000001 lp=0x0000000000000000} tagMSG *

    What is wp and lp?

    They would be the WPARAM parameter and the LPARAM parameters contains in the MSG structure
    • Marked as answer by MyCatAlex Saturday, August 26, 2017 10:33 PM
    Saturday, August 26, 2017 3:52 PM

All replies

  • While viewing/editing the source file, left click in the margin to the left of the statement that you want to stop at.  This will insert a breakpoint just prior to the execution of that statement.  The presence of the breakpoint is confirmed by a red circle in the margin at that point.
    • Marked as answer by MyCatAlex Saturday, August 26, 2017 1:51 PM
    Saturday, August 26, 2017 12:11 AM
  • It worked. Thanks, - MyCatAlex
    Saturday, August 26, 2017 1:53 PM
  • Well, there is another problem. After the breakpoint was reached, the VS went into a mode of executing external code and my code disappeared from the panel. How can I avoid it? I want to see my code, well, not mine actually, all the time.

    Thanks, - MyCatAlex

    Saturday, August 26, 2017 2:00 PM
  • Well, I think I cleared that hurdle. I clicked on "Continue execution." but there is another problem. It says "source not available." Why? It runs OK and performs all its functions, creating the GUI, etc as needed. Thanks.
    • Edited by MyCatAlex Saturday, August 26, 2017 2:05 PM
    Saturday, August 26, 2017 2:03 PM
  • It sounds like you are trying to step into a Win32 API function call in the same manner that you step through your own code.  When stepping through code in the debugger you need to step over, not step into, Win32 API function calls.
    Saturday, August 26, 2017 2:13 PM
  • My old friend @RLWA32! Thank you for showing up. I always press F11 which is step over but I end up in Assembly code anyway. Then I press F5 and jump out of there. I am making some progress but what a difference from Linux!

    +  &messages 0x0000001ef12fed90 {msg=0x0000031f wp=0x0000000000000001 lp=0x0000000000000000} tagMSG *

    What is wp and lp?

    Than yous, - MyCatAlex

    P.S. Sorry, I just realized that F11 is step into, so I did the wrong operation. Thanks.





    • Edited by MyCatAlex Saturday, August 26, 2017 3:41 PM
    Saturday, August 26, 2017 3:34 PM
  • My old friend @RLWA32! Thank you for showing up. I always press F11 which is step over but I end up in Assembly code anyway. Then I press F5 and jump out of there. I am making some progress but what a difference from Linux!

    +  &messages 0x0000001ef12fed90 {msg=0x0000031f wp=0x0000000000000001 lp=0x0000000000000000} tagMSG *

    What is wp and lp?

    They would be the WPARAM parameter and the LPARAM parameters contains in the MSG structure
    • Marked as answer by MyCatAlex Saturday, August 26, 2017 10:33 PM
    Saturday, August 26, 2017 3:52 PM
  • Thank you, - MyCatAlex
    Saturday, August 26, 2017 10:34 PM