tags:

views:

533

answers:

3

I have installed GDB 7.0 and python per the following instructions. In the same manual, there is a mention of this file stl-views-1.0.3.gdb. What confuses me is where it should be placed in order to enable pretty printing of stl containers. Would someone also explain to me all of this work?

Thanks

+3  A: 

in the gdb:

source {full_path}stl-views-1.0.3.gdb

now you'll have new commands, such as pvector, plist, pmap and more (replace {full_path} with the full path to the file.

You can also put the command source stl-views-1.0.3.gdb in ~/.gdbinit - and then you'll have it automatically every time you launch gdb.

Drakosha
Do I have to do it every time I load gdb? Can it be done by default? Shuold stl-views-1.0.3.gdb be located in the current working directory?
vehomzzz
Can't you just put it in your `~/.gdbinit`?
Jefromi
Can you elaborate? So I start gdb and I type that? I just get `No such file or directory.`
Kache4
@Kache4 do you actually have the file? source stl-views-1.0.3.gdb is NOT a command, but rather a command followed by the file name, although you've probably figured this out by now.
vehomzzz
@Andrei: I guess not. `locate` doesn't find anything. Where can I get it? Quick Google search and search using Ubuntu synaptic didn't get me anything.
Kache4
@Kache4: there's a link in the question itself
Drakosha
I agree with "Employed Russian". This is the old - pre gdb7 - way of doing things. See the related http://stackoverflow.com/questions/2492020/how-to-view-contents-of-stl-containers-using-gdb-7-x
nimrodm
+2  A: 

As far as I can tell, stl-views are the old way to examine STL containers, and are inferior to the new python support in almost every way.

You should use libstdcxx_printers python pretty-printers instead.

Employed Russian
A: 

FYI, these instructions dont work on Ubuntu lucid at least. See this bug i just filed

kert