0
votes

I'm new to c++ debugging and LLDB. I'm using VSCode with its c++ adapter, LLDB as the debugger, and bazel as the build system. My application deals with manipulating images. The application runs quickly but debugging it is very slow. That's because once I've loaded the images into memory, it takes about 20 seconds to a minute to step through each line. My assumption is that the raw images are too much for the debugger. If I use a small image, then I'm able to step through the code quickly inside the debugger

My question is: is there a way to tell the debugger to ignore the image loaded variables? Or perhaps to lazy-load the image variable data? I'm more interested in the other variables such as the matrices.

1
it is not the debugger that does the image loading it is the program, the debugger traverse the stack frames and the global variables. - rioV8
That's true and wasn't my intent to make it seem like it did. I've updated the question. - NateW
If you are not interested in the images, debug with very small images - rioV8
As I mentioned in the post, I am debugging with very small images. - NateW
However, some of the algorithms, such as feature extraction, work very differently with smaller images. - NateW

1 Answers

1
votes

The underlying debugger, lldb, doesn't fetch any variables unless explicitly asked. It's always the UI that requests variable values.

In Xcode, if you close the Locals View, Xcode won't ask lldb to fetch variables. That does speed up stepping in frames with big local variables.

Then if you need to keep an eye on one or two of the variables while stepping you can use tooltips or the debugger console to print them on demand. You can also set up target stop-hooks in the lldb Console and use them to auto-print the variables you are tracking.

Some UI's also separate the "Locals" view from the "Watched Expression" view, so you can close the former and put the variables you need to see in the latter.

I don't know if VSCode allows you to close the Locals view, but if it does that might be a way to handle this problem.