Had to modify tasks.json to debug (?)

After getting my STlink debugger and following the (previous) OpenOCD installation instructions, I was able to build and start to debug a modified example program (pod looper), but I could only run and pause in the called library functions and drivers, not my program.

Yesterday I enlisted the help of an experienced software engineer friend. He said that the tools were not compiling whatever the file is that connects to the source code (I guess). He modified the task.json file to comment out the “dependsOn” lines as shown below. Then it worked (!?)

I tried it again with the Seed Blink program, with exactly the same results. I had to comment out the “dependsOn” in its respective tasks.json file in order to debug properly - stopping at main(), single-stepping, setting and running to breakpoints, watching variables, etc.

My friend was also surprised that the tasks process seems to recompile everything every time, rather than only what has changed - in this case my modified example program.

I can make progress now that I know the magic words. On the other had, it would be nice to know what is going on.

1 Like

Interesting findings. Thanks for sharing!

Interesting that skipping the library rebuilds fixed the debugging in your main project. I’ll look into what might be causing soon.

I also agree that doing a complete rebuild is overkill (there are times where its useful, especially if you’re only editing a macro (i.e. #define) somewhere in a library header file that the compiler might not pick up, but it certainly shouldn’t be the default.

I’ll make a github issue on the examples repo for us to revisit these tasks. As there are a few other things related to the VS Code workflow that I’m looking to improve as well.

1 Like