I'm using Eclipse with the CDT plugin to develop in C++. I'm also using std library to create vectors and I am having an issue while debugging: Eclipse does not allow me to view the content of the vectors.
Is there any way to be able to debug it properly?
Debugging STL containers in Eclipse is not quite straightforward. Please have a look at this question and the answers explaining the reasons for this. The simplest way without fiddling with the GDB for me is this answer, which can be summarized as follows:
Expand your vector in the variable view, you should find a nested variable _M_start
. Right-click, choose "Display As Array..." and enter the desired range. The elements should then show up nested under _M_start
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With