User forums > General (but related to Code::Blocks)

Feature Request/Help: GDB Vector, nested vector, and strut viewing.[SOLVED]

<< < (3/6) > >>

oBFusCATed:
I see nothing related to watches here.
Please post a log from a debug session, where a breakpoint is hit and you add a watch to a vector.

PureBlackSin:

--- Quote from: oBFusCATed on July 20, 2012, 11:35:22 am ---I see nothing related to watches here.
Please post a log from a debug session, where a breakpoint is hit and you add a watch to a vector.

--- End quote ---

Terribly sorry, here's the stuff you were looking for:


--- Code: ---Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: /host/James/Ubuntu/C-C++/ParseWords/
Adding source dir: /host/James/Ubuntu/C-C++/ParseWords/
Adding file: /host/James/Ubuntu/C-C++/ParseWords/bin/Debug/ParseWords
Changing directory to: /host/James/Ubuntu/C-C++/ParseWords/.

[debug]LD_LIBRARY_PATH=.:
[debug]Command-line: /usr/bin/gdb -nx -fullname  -quiet  -args /host/James/Ubuntu/C-C++/ParseWords/bin/Debug/ParseWords
[debug]Working dir : /host/James/Ubuntu/C-C++/ParseWords

Starting debugger: /usr/bin/gdb -nx -fullname  -quiet  -args /host/James/Ubuntu/C-C++/ParseWords/bin/Debug/ParseWords
done

[debug]> set prompt >>>>>>cb_gdb:
[debug]Skip initializing the scripting!

Setting breakpoints

[debug]Reading symbols from /host/James/Ubuntu/C-C++/ParseWords/bin/Debug/ParseWords...done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2) 7.4-2012.04
[debug]Copyright (C) 2012 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "x86_64-linux-gnu".
[debug]For bug reporting instructions, please see:
[debug]<http://bugs.launchpad.net/gdb-linaro/>.
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2) 7.4-2012.04

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor intel
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Function "__cxa_throw" not defined.
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> directory /host/James/Ubuntu/C-C++/ParseWords/
[debug]>>>>>>cb_gdb:
[debug]> break "/host/James/Ubuntu/C-C++/ParseWords/main.cpp:220"
[debug]Queued:[tty /dev/pts/1]
[debug]Breakpoint 2 at 0x401fcd: file /host/James/Ubuntu/C-C++/ParseWords/main.cpp, line 220.
[debug]>>>>>>cb_gdb:
[debug]> tty /dev/pts/1
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Breakpoint 2, ParseThesaurus (inFilename=..., inWordPackageArray=...) at /host/James/Ubuntu/C-C++/ParseWords/main.cpp:220
[debug]/host/James/Ubuntu/C-C++/ParseWords/main.cpp:220:5438:beg:0x401fcd
[debug]>>>>>>cb_gdb:

At /host/James/Ubuntu/C-C++/ParseWords/main.cpp:220

[debug]> whatis ParsedStringArray
[debug]type = std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >
[debug]>>>>>>cb_gdb:
[debug]> output ParsedStringArray
[debug]{<std::_Vector_base<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >> = {_M_impl = {<std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = {<__gnu_cxx::new_allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = {<No data fields>}, <No data fields>}, _M_start = 0xa3daf0, _M_finish = 0xa55af0, _M_end_of_storage = 0xa5daf0}}, <No data fields>}>>>>>>cb_gdb:

--- End code ---

ollydbg:

--- Quote from: PureBlackSin on July 20, 2012, 12:33:19 pm ---


--- Code: ---Building to ensure sources are up-to-date
...

At /host/James/Ubuntu/C-C++/ParseWords/main.cpp:220

[debug]> whatis ParsedStringArray
[debug]type = std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >
[debug]>>>>>>cb_gdb:
[debug]> output ParsedStringArray
[debug]{<std::_Vector_base<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >> = {_M_impl = {<std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = {<__gnu_cxx::new_allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = {<No data fields>}, <No data fields>}, _M_start = 0xa3daf0, _M_finish = 0xa55af0, _M_end_of_storage = 0xa5daf0}}, <No data fields>}>>>>>>cb_gdb:

--- End code ---

--- End quote ---
From the above log message, I believe that either you use a gdb which does not have python enabled or you stl pretty printer does not load correctly.

oBFusCATed:
Another thing you could try is to stop on a breakpoint and then to execute the following command:

--- Code: ---info pretty-printer

--- End code ---

This will list all available printers.
If the list is empty, the printers have not been installed correctly.
If the command is not supported your gdb doesn't support python.

PureBlackSin:

--- Code: ---Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: /host/James/Ubuntu/C-C++/ParseWords/
Adding source dir: /host/James/Ubuntu/C-C++/ParseWords/
Adding file: /host/James/Ubuntu/C-C++/ParseWords/bin/Debug/ParseWords
Changing directory to: /host/James/Ubuntu/C-C++/ParseWords/.

[debug]LD_LIBRARY_PATH=.:
[debug]Command-line: /usr/bin/gdb -nx -fullname  -quiet  -args /host/James/Ubuntu/C-C++/ParseWords/bin/Debug/ParseWords
[debug]Working dir : /host/James/Ubuntu/C-C++/ParseWords

Starting debugger: /usr/bin/gdb -nx -fullname  -quiet  -args /host/James/Ubuntu/C-C++/ParseWords/bin/Debug/ParseWords
done

[debug]> set prompt >>>>>>cb_gdb:
[debug]Skip initializing the scripting!

Setting breakpoints

[debug]Reading symbols from /host/James/Ubuntu/C-C++/ParseWords/bin/Debug/ParseWords...done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2) 7.4-2012.04
[debug]Copyright (C) 2012 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "x86_64-linux-gnu".
[debug]For bug reporting instructions, please see:
[debug]<http://bugs.launchpad.net/gdb-linaro/>.
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2) 7.4-2012.04

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor intel
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Function "__cxa_throw" not defined.
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> directory /host/James/Ubuntu/C-C++/ParseWords/
[debug]>>>>>>cb_gdb:
[debug]> break "/host/James/Ubuntu/C-C++/ParseWords/main.cpp:220"
[debug]Breakpoint 2 at 0x401fcd: file /host/James/Ubuntu/C-C++/ParseWords/main.cpp, line 220.
[debug]>>>>>>cb_gdb:
[debug]> tty /dev/pts/1
[debug]Queued:[tty /dev/pts/1]
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Breakpoint 2, ParseThesaurus (inFilename=..., inWordPackageArray=...) at /host/James/Ubuntu/C-C++/ParseWords/main.cpp:220
[debug]/host/James/Ubuntu/C-C++/ParseWords/main.cpp:220:5418:beg:0x401fcd
[debug]>>>>>>cb_gdb:

At /host/James/Ubuntu/C-C++/ParseWords/main.cpp:220

[debug]> whatis ParsedStringArray
[debug]type = std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >
[debug]>>>>>>cb_gdb:
[debug]> output ParsedStringArray
[debug]{<std::_Vector_base<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >> = {_M_impl = {<std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = {<__gnu_cxx::new_allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = {<No data fields>}, <No data fields>}, _M_start = 0xa3daf0, _M_finish = 0xa55af0, _M_end_of_storage = 0xa5daf0}}, <No data fields>}>>>>>>cb_gdb:

> info pretty-printer

[debug]> info pretty-printer
[debug]>>>>>>cb_gdb:

--- End code ---

Looks like they are not installed properly...... I'll have a crack and report back, I still can't work out why all this isn't default in the setup...

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version