nRF Connect VSCode Extension - Large project cannot display thread information

I have an nRF5340 project (that I cannot share) that uses zephyr, many modules, and a large application code space.

After much time crawling the VSCode extension javascript I have found that thread information is displayed from the symbol information that is cache loaded when a debugging session starts.

This information is collected by running a command similar to

/opt/nordic/ncs/toolchains/19127b768d/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-nm build/zephyr/zephyr.elf -nSalt d

For my project the output from this command is greater than 1.3MB while the VSCode extension is using the default 'maxBuffer' option when calling child_process.exec which is 200 KB. The result is that the debugging symbols are not loaded and thread info cannot be displayed because the stdout buffer is overflowed.

My current fix is to find and replace the following string:

this.env(process.env[Du])

with this instead

this.env(process.env[Du]),maxBuffer:1024*2000

In the file ~/.vscode/extensions/nordic-semiconductor.nrf-connect-2024.2.214-linux-x64/dist/extension.js

This allows the child_process to exec with a stdout buffer of 2MB. I would suggest that the 2000 value I used should be an extension setting or similar.

Related