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.

Adarsh Konchady
  • 2,577
  • 5
  • 30
  • 50
  • You can always use print *var_name to print out the contents – Jesus Ramos Jan 26 '12 at 04:18
  • 1
    I am using the same method to print the contents of (SmallVectorImpl &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:
    $3 = (llvm::SmallVectorImpl<::ValueEntry> &) @0xbfffeef4: { ::ValueEntry, false>> = { ::ValueEntry>> = { = { BeginX = 0xbfffef00, EndX = 0xbfffef28, . . .
    – Adarsh Konchady Jan 26 '12 at 04:50

2 Answers2

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

Russell Zahniser
  • 16,188
  • 39
  • 30
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.

Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547