3

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.

2
  • You can always use print *var_name to print out the contents Commented Jan 26, 2012 at 4:18
  • 1
    I 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, . . . Commented Jan 26, 2012 at 4:50

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

Comments

0

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

I am using petty printer only to print the values but it still doesn't display the values of LLVM types like "Instruction *"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.