I launch my program in C#, which then calls some unmanaged C++.
When I break on a line in the unmanaged C++, the 'New Data Breakpoint' menu item is grayed out.
Is there anyway around this?
It's easy to set a breakpoint in Python code to i.e. inspect the contents of variables at a given line. Add import pdb; pdb. set_trace() at the corresponding line in the Python code and execute it. The execution will stop at the breakpoint.
Set breakpoints in source code To set a breakpoint in source code, click in the far left margin next to a line of code. You can also select the line and press F9, select Debug > Toggle Breakpoint, or right-click and select Breakpoint > Insert breakpoint.
Select the C++ project in Solution Explorer and click the Properties icon, press Alt+Enter, or right-click and choose Properties. In the <Project> Property Pages dialog box, expand Configuration Properties, and then select Debugging. Set Debugger Type to Mixed or Auto. Select OK.
A data breakpoint can be created in any of the listed windows by right-clicking (or Shift + F10) the desired variable and selecting Break When Value Changes while in break mode.
So to do this I had to:
yech
To set a data breakpoint in the native portion of a mixed mode process, see the answer posted by jyoung.
Visual Studio disables data breakpoints when running anything but pure, native code. See this post for a partial explanation why from a VS Program Manager.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With