Solution
There are multiple reasons behind the possible slowdown during the debugging process of the LabWindows/CVI application. There are some recommendations to improve the debugging time:
- Use the latest version of LabWindows/CVI available for Windows 10 (version 2020). There are several improvements and bug fixes from one version to another. Using the latest version will ensure all those bug fixes are included. Improvements have been seen when using a newer version of LabWindows/CVI when compared to version 2017 on Windows 10.
- Resource tracking takes time. It is turned on by default in Extended debugging mode. You can use Standard mode instead if you do not need this feature. In LabWindows/CVI 2017, the development environment may slow down or hang when performing extended debugging with the Resource Tracking window.
- Watchpoints set to "break on change". Machines provide hardware support for a limited number of them and that is fast. If you have too many or if you are watching something larger than 4 byte (32-bit) or 8 bytes (64-bit), then they will be very slow. Watchpoints set to "update continuously" are also slow and should be avoided.
- One option is to run outside of the debugger, the run-time checking will still catch run-time errors and offer to debug the executable at that point (a dialog is shown and offers to break into/debug the executable from then on). It is not as convenient as doing everything within the same CVI instance but might serve as a workaround. Some ideas on how to make this more convenient:
static void breakpoint()
{
char c, *ptr = &c;
ptr+2; // <- non-fatal error because pointer arithmetic is out of bounds
}