I export a project from mtb2.1 for vscode but cannot see the memory window.
I checked online and found that vscode does not have support for memory window.
Reference Links -
So a workaround would be to use the 'x <address>' gdb command as suggested in those links.
Once you start debugging, go to your DEBUG CONSOLE and type in the command.
For example, I have created a variable - variable_dummy, initialized the variable to 8 and in the .map file I got the address of the variable as 0x080023a8. So, in the DEBUG CONSOLE I used the command x 0x080023a8 as shown -
Along with this, you can check all the local and global variables in the VARIABLES section. You can also add these variables to watch in the WATCH section as shown -
To view the Core registers and the peripheral registers you can follow the steps mentioned below. This is an extrapolation of DheerajK_81's response in the thread - GPIO registers are not displayed in memory window Re: GPIO registers are not displayed in memory window
1. Open the launch.json file present inside .vscode folder
2. Search "svdFile" and add the path to the SVD file. Please refer to Dheeraj's response to know the path to SVD file.
3. So your svdFile file configuration should be similar to -
// svdFile is optional, it can be very large.
Now when you debug the device, you should be able to view the registers as shown -
Please let me know if this works.
Thanks and Regards,
Rakshith M B
1 of 1 people found this helpful
Thank you very much for your solution.
I checked your suggestion. Everything worked.
I have additional information how to display with WATCH section.
It can also be described as follows：
Unfortunately, the data is not displayed as hexadecimal, but as decimal in my VSCODE. if you have any idea to solve it, please let me know.
Thank you for sharing the information!
I tried to find out a way to display the values in hexadecimal. The responses in various vscode git issues worked only with one memory location. An array of memory was still displayed in decimal.
One workaround might be to use the gdb command again. I used the command "x/16x 0x80023a8" in the console. It displays 16 x 32bits data. You can check this link for information regarding this command - https://visualgdb.com/gdbreference/commands/x
The main disadvantage with this is that you will have to type the command every time you want to read the memory.
So, I was trying to add the command to a handle which will be called each time the debugger is paused. I put the command in overrideLaunchCommands in launch.json file and the memory values were displayed each time the debugger was launched as shown -
I searched online and in the VSCode IntelliSense suggestions for the handle called on debugger pause (during step, breakpoint, etc) but I was not able to find one. What I am searching for is something similar to "onPauseCommands". Please let me know if you are aware of a way to do this. Meanwhile, I will check with the internal teams if they have any suggestions or if they are aware of any other methods. As this is a VSCode feature, I cannot assure you of a viable workaround.
Hope this helps,
Thanks and Regards,
Rakshith M B
Thank you for your research and information sharing.
I was able to get very fruitful information about debugging of VSCODE from you.