User forums > Using Code::Blocks
Showing vector elements in debugger
BlueHazzard:
how does your code looks?
have you updated the scripts?
[edit:] you are right, the space makes no difference...
have you tested my simple example code from the top?
nji:
It's exactly your code snipplet from above.
I updated the scripts.
test is shown correctly in debugger and in watches, while test[1] is not:
--- Code: ---[debug]> whatis test[1]
[debug]type = std::vector<double, std::allocator<double> >::reference
[debug]>>>>>>cb_gdb:
[debug]> output test[1]
[debug](__gnu_cxx::__alloc_traits<std::allocator<double> >::value_type &) @0x19de910: <error reading variable>>>>>>>cb_gdb:
[debug]> whatis test
[debug]type = std::vector<double>
[debug]>>>>>>cb_gdb:
[debug]> output test
[debug]std::vector of length 2, capacity 2 = {22.440000000000001, 1.3795933261199322e-306}>>>>>>cb_gdb:
--- End code ---
oBFusCATed:
The problem is in gdb (or the pretty printers). It tells you that it cannot read the value of this expression.
nji:
How can this be?
I downloaded the newest gdb (from link above) and scripts.
And "test[1]" is not a too complex expression ... an error in gdb/ scripts should have shown before.
What about python?
BlueHazzard:
if this matters, i have this gdb version: GNU gdb (GDB) 7.10.50.20160130-git
probably i got it from here: http://forums.codeblocks.org/index.php/topic,11301.0.html
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version