By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,548 Members | 1,172 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,548 IT Pros & Developers. It's quick & easy.

Printing all STL objects of .cc code in GDB

P: 4
I have required setup in my .gdbinit file to print all STL objects. I copied code from to .gdbinit. Then, I run my .cc code, which print all STL objects, other than std::List. It gives some data which is not understandable. Can somebody suggest what I am doing wrong.
I just have 2 lines in my .cc code for list
Jun 16 '16 #1
Share this Question
Share on Google+
2 Replies

Expert Mod 5K+
P: 9,197
The list<>::push_back() adds to the end of the list. In this case 17 and 66 are added tio the end of the int list.

Just read up on the list<> member functions for more info.
Jun 17 '16 #2

P: 4
The problem is it doesn't show me the output the way I want it to be for <list>. Other than that, for vector,map,multimap and all other STL it prints the output properly. I have the similar representation for vector as well in the .cc code and it works fine.

You can find the output in the attachment.
<<Note : I used pretty printers for STL objects in my .gdbinit file>>
Attached Images
File Type: jpg Capture.jpg (44.6 KB, 54 views)
Jun 17 '16 #3

Post your reply

Sign in to post your reply or Sign up for a free account.