When I try to display the values of certain data structures(including STL and certain LLVM types like Instruction *) using Eclipse, it only gives me the address and not their contents. My eclipse is integrated with GDB. Please help.
-
You can always use print *var_name to print out the contentsJesus Ramos– Jesus Ramos2012-01-26 04:18:12 +00:00Commented Jan 26, 2012 at 4:18
-
1I am using the same method to print the contents of (SmallVectorImpl<ValueEntry> &Ops) which is implemented in LLVM. It still doesn't give the contents in a proper understandable format. It gives the values in the following format:<br> $3 = (llvm::SmallVectorImpl<<unnamed>::ValueEntry> &) @0xbfffeef4: { <llvm::SmallVectorTemplateBase<<unnamed>::ValueEntry, false>> = { <llvm::SmallVectorTemplateCommon<<unnamed>::ValueEntry>> = { <llvm::SmallVectorBase> = { BeginX = 0xbfffef00, EndX = 0xbfffef28, . . .Adarsh Konchady– Adarsh Konchady2012-01-26 04:50:14 +00:00Commented Jan 26, 2012 at 4:50
Add a comment
|
2 Answers
You may need to set up pretty-printers for the various STL containers. See this link:
http://wiki.eclipse.org/CDT/User/FAQ#How_can_I_inspect_the_contents_of_STL_containers.3F
Comments
The latest gdb (7.3) and latest GCC (4.6) made significant progress in displaying STL containers. Also, recent gdb are scriptable in python, and you could take advantage of that (to e.g. script gdb to pretty print your values).
NB: your question is very probably unrelated to Eclipse.
1 Comment
Adarsh Konchady
I am using petty printer only to print the values but it still doesn't display the values of LLVM types like "Instruction *"