python
import sys
sys.path.insert(0, 'PATH_TO_TDM\share\gcc-4.9.2\python')
from libstdcxx.v6.printers import register_libstdcxx_printers
end
CAN THIS BE POSSIBLE?See it as learning.. If you know the things behind all this you will get a better programmer
Or is it a joke?
In the year 2017 you have to printf to debug a c++ standard element, when using
codeblock/ gcc?
Or will the next release of codeblocks do it all by itself?Don't know... The team abandoned the internal scripting and decided to use the gdb internal python scripting. If you use a compiler that has no python support cb could not do anything about this... In general this are gdb problems and not really codeblocks problems ;)
What i have done and it seems to work:No unfortunately NOT.
1) Use a python enabled gdb. I don't know but i think the tdm gcc has python enabled
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: D:\Guido\develop\TestMovieIn\
Adding source dir: D:\Guido\develop\TestMovieIn\
Adding file: D:\Guido\develop\TestMovieIn\bin\Debug\TestMovieIn.exe
Changing directory to: D:/Guido/develop/TestMovieIn/.
Set variable: PATH=.;D:\Guido\develop\opencv\build_codeblocks\install\x86\mingw\lib;C:\Program Files (x86)\CodeBlocks\MinGW\bin;C:\Program Files (x86)\CodeBlocks\MinGW;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Windows Live\Shared
[debug]Command-line: C:\Program Files (x86)\CodeBlocks\MinGW\bin\gdb32.exe -nx -fullname -quiet -args D:/Guido/develop/TestMovieIn/bin/Debug/TestMovieIn.exe
[debug]Working dir : D:\Guido\develop\TestMovieIn
Starting debugger: C:\Program Files (x86)\CodeBlocks\MinGW\bin\gdb32.exe -nx -fullname -quiet -args D:/Guido/develop/TestMovieIn/bin/Debug/TestMovieIn.exe
done
[debug]> set prompt >>>>>>cb_gdb:
[debug]Skip initializing the scripting!
Setting breakpoints
[debug]Reading symbols from D:/Guido/develop/TestMovieIn/bin/Debug/TestMovieIn.exe...
[debug]done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.9.1
[debug]Copyright (C) 2015 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 "mingw32".
[debug]Type "show configuration" for configuration details.
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]Find the GDB manual and other documentation resources online at:
[debug]<http://www.gnu.org/software/gdb/documentation/>.
[debug]For help, type "help".
[debug]Type "apropos word" to search for commands related to "word".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off
Debugger name and version: GNU gdb (GDB) 7.9.1
[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 new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> python
import sys
sys.path.insert(0, 'C:\Program Files (x86)\CodeBlocks\MinGW\share\gcc-4.9.2\python')
from libstdcxx.v6.printers import register_libstdcxx_printers
end
[debug]>>>>>>>>>>cb_gdb:
[debug]> directory D:/Guido/develop/TestMovieIn/
[debug]Source directories searched: D:/Guido/develop/TestMovieIn;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> break "D:/Guido/develop/TestMovieIn/main.cpp:38"
[debug]Breakpoint 2 at 0x401579: file D:\Guido\develop\TestMovieIn\main.cpp, line 38.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: D:\Guido\develop\TestMovieIn\bin\Debug\TestMovieIn.exe
Child process PID: 4544
[debug][New Thread 4544.0x114c]
[debug][New Thread 4544.0x13dc]
[debug][Switching to Thread 4544.0x13dc]
[debug]Breakpoint 2, ComputePart (source=..., diffVector=..., nLap=@0x55f2ce: 20, nThreads=@0x4d1fe48: 1, nThreadNo=@0x55f2c8: 0) at D:\Guido\develop\TestMovieIn\main.cpp:38
[debug]D:\Guido\develop\TestMovieIn\main.cpp:38:1231:beg:0x401579
[debug]>>>>>>cb_gdb:
At D:\Guido\develop\TestMovieIn\main.cpp:38
[debug]> info locals
[debug]capt = <incomplete type>
[debug]refS = {width = 1280, height = 720}
[debug]frame = {flags = 1124007936, dims = 0, rows = 0, cols = 0, data = 0x0, datastart = 0x0, dataend = 0x0, datalimit = 0x0, allocator = 0x0, u = 0x0, size = {p = 0x4d1fcb0}, step = {p = 0x4d1fcd8, buf = {0, 0}}}
[debug]s = {<cv::Vec<double, 4>> = {<cv::Matx<double, 4, 1>> = {val = {0, 0, 0, 0}}, <No data fields>}, <No data fields>}
[debug]frameRes = {flags = 1124007936, dims = 0, rows = 0, cols = 0, data = 0x0, datastart = 0x0, dataend = 0x0, datalimit = 0x0, allocator = 0x0, u = 0x0, size = {p = 0x4d1fce8}, step = {p = 0x4d1fd10, buf = {0, 0}}}
[debug]frameDuo = {_M_elems = {{flags = 1124007936, dims = 0, rows = 0, cols = 0, data = 0x0, datastart = 0x0, dataend = 0x0, datalimit = 0x0, allocator = 0x0, u = 0x0, size = {p = 0x4d1fd20}, step = {p = 0x4d1fd48, buf = {0, 0}}}, {flags = 1124007936, dims = 0, rows = 0, cols = 0, data = 0x0, datastart = 0x0, dataend = 0x0, datalimit = 0x0, allocator = 0x0, u = 0x0, size = {p = 0x4d1fd58}, step = {p = 0x4d1fd80, buf = {0, 0}}}}}
[debug]frameNum = 0
[debug]>>>>>>cb_gdb:
[debug]> info args
[debug]source = {static npos = <optimized out>, _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x55f27c "26229.wmv"}}
[debug]diffVector = @0x28fecc: {<std::_Vector_base<double, std::allocator<double> >> = {_M_impl = {<std::allocator<double>> = {<__gnu_cxx::new_allocator<double>> = {<No data fields>}, <No data fields>}, _M_start = 0x1c19678, _M_finish = 0x1c19678, _M_end_of_storage = 0x1c80850}}, <No data fields>}
[debug]nLap = @0x55f2ce: 20
[debug]nThreads = @0x4d1fe48: 1
[debug]nThreadNo = @0x55f2c8: 0
[debug]>>>>>>cb_gdb:
[debug]> whatis diffVector
[debug]type = std::vector<double, std::allocator<double> > &
[debug]>>>>>>cb_gdb:
[debug]> output diffVector
[debug](std::vector<double, std::allocator<double> > &) @0x28fecc: {<std::_Vector_base<double, std::allocator<double> >> = {_M_impl = {<std::allocator<double>> = {<__gnu_cxx::new_allocator<double>> = {<No data fields>}, <No data fields>}, _M_start = 0x1c19678, _M_finish = 0x1c19678, _M_end_of_storage = 0x1c80850}}, <No data fields>}>>>>>>cb_gdb:
[debug]> whatis diffVector [2]
[debug]type = std::vector<double, std::allocator<double> >::reference
[debug]>>>>>>cb_gdb:
[debug]> output diffVector [2]
[debug](__gnu_cxx::__alloc_traits<std::allocator<double> >::value_type &) @0x147f660: 1.3795933261199322e-306>>>>>>cb_gdb:
s = {<cv::Vec<double, 4>> = {<cv::Matx<double, 4, 1>> = {val = {0, 0, 0, 0}}, <No data fields>}, <No data fields>}
whatis diffVector
[debug]type = std::vector<double, std::allocator<double> > &
[debug]>>>>>>cb_gdb:
[debug]> output diffVector
[debug](std::vector<double, std::allocator<double> > &) @0x28fecc: {<std::_Vector_base<double, std::allocator<double> >> = {_M_impl = {<std::allocator<double>> = {<__gnu_cxx::new_allocator<double>> = {<No data fields>}, <No data fields>}, _M_start = 0x1c19678, _M_finish = 0x1c19678, _M_end_of_storage = 0x1c80850}}, <No data fields>}>>>>>>cb_gdb:
vector<double> test;
test.push_back( 22.44 );
test.push_back( 1.3795933261199322e-306 );
[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:
test [1]
[debug]> whatis test[1]
[debug]type = double
[debug]>>>>>>cb_gdb:
[debug]> output test[1]
[debug]1.3795933261199322e-306>>>>>>cb_gdb:
[debug]> whatis diffVector [2]
[debug]type = std::vector<double, std::allocator<double> >::reference
whatis diffVector
[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[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:
And "test[1]" is not a too complex expression ...Why do you think this is not a complex expression?
M$'s comm. ed.Are you talking about visual studio?
Do you want my opinion about a development chain where nothing fits together, and debugging vector[1] is impossible?This won't change anything. Patches improve the situation. Ranting is just ranting.
OK, if the python scripts have to match the c++ standard library ... I moved the original scripts (from mingw 4.9.2) back.Yes, they need to match, because the standard library changes its internals and the python script need to know the internals of the library.
Effect: same effect.
Does gdb has to match too?Only to the point that the Python APIs used in the scripts are compatible. But I think the gdb's python apis are relatively stable.
You must install Python 2.7.5 release 32bit version on your system, as my build was linked to this python release.you need to install python 2.7.5: https://www.python.org/download/releases/2.7.5/
python
import sys
sys.path.insert(0, 'TDM-GCC-32\share\gcc-4.9.2\python')
from libstdcxx.v6.printers import register_libstdcxx_printers
#register_libstdcxx_printers (None)
end
source TDM-GCC-32\bin\stl.gdb
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<double> test;
test.push_back( 22.44 );
test.push_back( 1.3795933261199322e-306 );
cout << "Hello world!" << endl;
return 0;
}
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: ****\
Adding source dir: ****\
Adding file: ****\bin\Debug\rerreer.exe
Changing directory to: ****.
Set variable: PATH=#######
[debug]Command-line: TDM-GCC-32\bin\gdb.exe -fullname -quiet -nx -args ****bin/Debug/rerreer.exe
[debug]Working dir : ****
Starting debugger: TDM-GCC-32\bin\gdb.exe -fullname -quiet -nx -args ****bin/Debug/rerreer.exe
done
[debug]> set prompt >>>>>>cb_gdb:
[debug]Skip initializing the scripting!
Setting breakpoints
[debug]Reading symbols from ****bin/Debug/rerreer.exe...done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.10.50.20160130-git
[debug]Copyright (C) 2016 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 "mingw32".
[debug]Type "show configuration" for configuration details.
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]Find the GDB manual and other documentation resources online at:
[debug]<http://www.gnu.org/software/gdb/documentation/>.
[debug]For help, type "help".
[debug]Type "apropos word" to search for commands related to "word".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off
Debugger name and version: GNU gdb (GDB) 7.10.50.20160130-git
[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 200
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source TDM-GCC-32\bin\stl.gdb
[debug]> directory ****
[debug]>>>>>>cb_gdb:
[debug]> break "****main.cpp:12"
[debug]Source directories searched: ****/rerreer;$cdir;$cwd
[debug]>>>>>>cb_gdb:Breakpoint 2 at 0x4013ce: file ****\main.cpp, line 12.
Source directories searched: ****/rerreer;$cdir;$cwd
[debug]> run
[debug]>>>>>>cb_gdb:Starting program: ****\bin\Debug\rerreer.exe
[debug]> info frame
Child process PID: 7276
[debug][New Thread 7276.0x16ec]
[debug]Breakpoint 2, main () at ****\main.cpp:12
[debug]****\main.cpp:12:187:beg:0x4013ce
[debug]>>>>>>cb_gdb:Stack level 0, frame at 0x28ff30:
At ****\main.cpp:12
[debug]> whatis test
[debug] eip = 0x4013ce in main (****\main.cpp:12); saved eip = 0x4010fd
[debug] source language c++.
[debug] Arglist at 0x28ff18, args:
[debug] Locals at 0x28ff18, Previous frame's sp is 0x28ff30
[debug] Saved registers:
[debug] ebx at 0x28ff0c, ebp at 0x28ff18, esi at 0x28ff10, edi at 0x28ff14, eip at 0x28ff2c
[debug]>>>>>>cb_gdb:type = std::vector<double>
[debug]> output test
[debug]>>>>>>cb_gdb:
[debug]> whatis test[2]
[debug]std::vector of length 2, capacity 2 = {22.440000000000001, 1.3795933261199322e-306}>>>>>>cb_gdb:type = double
[debug]> output test[2]
[debug]>>>>>>cb_gdb:
[debug]> whatis test[0]
[debug]-2.5301706769843864e-098>>>>>>cb_gdb:type = double
[debug]> output test[0]
[debug]>>>>>>cb_gdb:
[debug]> whatis test[1]
[debug]22.440000000000001>>>>>>cb_gdb:type = double
[debug]> output test[1]
[debug]>>>>>>cb_gdb:
[debug]> bt 30
[debug]1.3795933261199322e-306>>>>>>cb_gdb:#0 main () at ****\main.cpp:12
[debug]>>>>>>cb_gdb:
python
import sys
sys.path.insert(0, 'C:\Program Files (x86)\CodeBlocks\MinGW\share\gcc-4.9.2\python/libstdcxx/v6')
from printers import register_libstdcxx_printers
register_libstdcxx_printers (None)
end
"gdb.exe - systemerror.
The program cannot be startet, as python27.dll is missing on your computer."
You must install Python 2.7.5 release 32bit version on your system, as my build was linked to this python release.
What I mean: If one installs c:b ... is it necessary to install python before, if gdb is python-enabled?codeblocks does not need python... gdb needs python. This are two separate projects. Codeblocks can not provide support for all things... And if codeblocks has to ship dlls for all possibly needed additional programs, the purpose of dlls is circumvented...
But ... as it seems ... that way didn't work ... at least at me.does it work after installing python? If not what is the error you are getting?
See it as learning.. If you know the things behind all this you will get a better programmer
One should hope, that in the next release of c:b debugging will work.
As in the actual one (16.01) in the packaged mingw the gdb was not python enabled, but in the actual tdm package it is, with everything included that is in need.
So hopefully the devolopers of c:b will have a look that this chain will work, without having to install this and that, patching here and there.
Does this message reach them?
While I don't see why your option (2.) helps.
As it shifts the responsiblity for a basic working system to the user (= make it even more unconvenient).
Especially (as the experience in this thread shows) as debug-enabling is not simply done by replacing the binaries.
Even higher hurdles for potential migrants from M$/ beginners.
As the actual tdm package (with python enabled gdb) is used in the nightlys: Are there any experiences?
You set "Problem" in paranthesis.
How shall I take that?
No "Problem" for professional like you? ;)
As I'm quite a newbie to c:b, mingw etc. (a "M$ migrant" ;)) I don't know how the development is organized here.
But - see the experience in the thread - to me it seems not so much a packaging problem, but a kind of configuration problem (as just replacing the debugger from the c:b 16.01package to an actual one does not work, although python enabled and included).
I do not use the debugger very much too - only in the (very very few ;)) cases when something doesn't work as I meant it.
As soons as I've finished "The Three Towers".
What a pity for you. :)
So you will never understand why to point blanket to the FAQ isn't very sensible after I explained in detail.
But maybe you're right ... it looks to be a "waste of time" with you.
100% agree.
Even more OT: ... that needs 170MB Installation, 146MB RAM and constantly 0.4% cpu on idle versus a uncool old in c and c++ written qTOX that uses 50MB RAM 0% cpu and 60MB installation...
@ollydbg:Copying only a dll file is not enough, you have to copy all the folders(such as the folder named "Lib" under python installed folder) to your GDB's bin folder. This will make the distribution a lot bigger, my personally python have a lot of non-standard packages installed in the "Lib" folder, so I don't want to to distribute the python, installing python is quite simple under Windows, just download the official python installer.
does it make sense to provide the python dll within your gdb download? Are there dependencies to other dlls (from python27.dll to other) too?
What if there is a python27.dll in the bin folder and one in the system folder? What version gets picked?
I see the frustration of the OP and i would like to do something against it...
Banned? :-\
Will you come with me?
Usually I don't explain my points ...
But for you I will do an exception:
Yes, I will take you for serious ...
... as soon as you do mature.
I always tried to explain/ to give reason for what I wrote above.
I can't imagine of anything more revealing weakness than the threat of a bann.
Oh man ...
Copying only a dll file is not enough, you have to copy all the folders(such as the folder named "Lib" under python installed folder) to your GDB's bin folder. This will make the distribution a lot bigger, my personally python have a lot of non-standard packages installed in the "Lib" folder, so I don't want to to distribute the python, installing python is quite simple under Windows, just download the official python installer.
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: ****rerreer\
Adding source dir: ****rerreer\
Adding file: ****rerreer\bin\Debug\rerreer.exe
Changing directory to: ****rerreer/.
Set variable: PATH=.####
[debug]Command-line: TDM-GCC-32\bin\gdb.exe -fullname -quiet -nx -args ****rerreer/bin/Debug/rerreer.exe
[debug]Working dir : ****rerreer
Starting debugger: TDM-GCC-32\bin\gdb.exe -fullname -quiet -nx -args ****rerreer/bin/Debug/rerreer.exe
done
[debug]> set prompt >>>>>>cb_gdb:
[debug]Skip initializing the scripting!
Setting breakpoints
[debug]Reading symbols from ****rerreer/bin/Debug/rerreer.exe...
[debug]done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.9.1
[debug]Copyright (C) 2015 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 "mingw32".
[debug]Type "show configuration" for configuration details.
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]Find the GDB manual and other documentation resources online at:
[debug]<http://www.gnu.org/software/gdb/documentation/>.
[debug]For help, type "help".
[debug]Type "apropos word" to search for commands related to "word".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off
Debugger name and version: GNU gdb (GDB) 7.9.1
[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 200
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source TDM-GCC-32\bin\stl.gdb
source TDM-GCC-32\share\gcc-4.9.2\python\wx\wx_print.py
[debug]>>>>>>cb_gdb:register wxWudgets printer
[debug]> directory ****rerreer/
[debug]>>>>>>cb_gdb:
[debug]> break "****rerreer/main.cpp:10"
[debug]Source directories searched: ****rerreer;$cdir;$cwd
[debug]>>>>>>cb_gdb:Breakpoint 2 at 0x4013b2: file ****rerreer\main.cpp, line 10.
Source directories searched: ****rerreer;$cdir;$cwd
[debug]> run
[debug]>>>>>>cb_gdb:
[debug]> info frame
[debug]Starting program: ****rerreer\bin\Debug\rerreer.exe
Child process PID: 7072
[debug][New Thread 7072.0x11a0]
[debug]Breakpoint 2, main () at ****rerreer\main.cpp:10
[debug]****rerreer\main.cpp:10:137:beg:0x4013b2
[debug]>>>>>>cb_gdb:Stack level 0, frame at 0x28ff30:
At ****rerreer\main.cpp:10
[debug]> bt 30
[debug] eip = 0x4013b2 in main (****rerreer\main.cpp:10); saved eip = 0x4010fd
[debug] source language c++.
[debug] Arglist at 0x28ff18, args:
[debug] Locals at 0x28ff18, Previous frame's sp is 0x28ff30
[debug] Saved registers:
[debug] ebx at 0x28ff0c, ebp at 0x28ff18, esi at 0x28ff10, edi at 0x28ff14, eip at 0x28ff2c
[debug]>>>>>>cb_gdb:#0 main () at ****rerreer\main.cpp:10
[debug]>>>>>>cb_gdb:
[debug]> whatis test
[debug]type = std::vector<double>
[debug]>>>>>>cb_gdb:
[debug]> output test
[debug]std::vector of length 1, capacity 1 = {22.440000000000001}>>>>>>cb_gdb:
[debug]> next
[debug]****rerreer\main.cpp:12:187:beg:0x4013ce
[debug]>>>>>>cb_gdb:
At ****rerreer\main.cpp:12
[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:
[debug]> bt 30
[debug]#0 main () at ****rerreer\main.cpp:12
[debug]>>>>>>cb_gdb:
[debug]> whatis test[0]
[debug]type = double
[debug]>>>>>>cb_gdb:
[debug]> output test[0]
[debug]22.440000000000001>>>>>>cb_gdb:
[debug]> whatis test[1]
[debug]type = double
[debug]>>>>>>cb_gdb:
[debug]> output test[1]
[debug]1.3795933261199322e-306>>>>>>cb_gdb:
As TDM gdb (python-enabled) works (more or less) for me (without havingi think it has something to do with your code (you never mentioned that you tested my code) or something with the python scripts.
installed python anywhere) I do doubt that it is necessary to install python separately.
For me it looks like a kind of "cooperation problem" (IDE, gdb, ...?).
[debug]>>>>>>cb_gdb:
[debug]> whatis diffVector
[debug]type = std::vector<double, std::allocator<double> > &
[debug]>>>>>>cb_gdb:
[debug]> output diffVector
[debug](std::vector<double, std::allocator<double> > &) @0x28fecc: {<std::_Vector_base<double, std::allocator<double> >> = {_M_impl = {<std::allocator<double>> = {<__gnu_cxx::new_allocator<double>> = {<No data fields>}, <No data fields>}, _M_start = 0x1c19678, _M_finish = 0x1c19678, _M_end_of_storage = 0x1c80850}}, <No data fields>}>>>>>>cb_gdb:
[debug]> whatis diffVector [2]
[debug]type = std::vector<double, std::allocator<double> >::reference
[debug]>>>>>>cb_gdb:
[debug]> output diffVector [2]
[debug](__gnu_cxx::__alloc_traits<std::allocator<double> >::value_type &) @0x147f660: 1.3795933261199322e-306>>>>>>cb_gdb:
[debug]> whatis test[0]
[debug]type = double
whatis diffVector [2]
[debug]type = std::vector<double, std::allocator<double> >::reference
[debug](__gnu_cxx::__alloc_traits<std::allocator<double> >::value_type &) @0x147f660: 1.3795933261199322e-306>>>>>>cb_gdb:
vector<double> test;
test.push_back( 22.44 );
test.push_back( 1.3795933261199322e-306 );
test[1];
[debug]> whatis test
[debug]type = std::vector<double, std::allocator<double> >
[debug]>>>>>>cb_gdb:
[debug]> output test
[debug]std::vector of length 2, capacity 2 = {22.440000000000001, 1.3795933261199322e-306}>>>>>>cb_gdb:
[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 &) @0x1bee910: <error reading variable>>>>>>>cb_gdb:
I also sometimes get lost with the "enable scripts" versus do not enable the scripts but have a gdb-python pair.