Hello world,
i am new in programmation (and in code::block); when i debugg, i want to see the contents of the vectors.
I have seen that in this forum there is already one subject ( http://forums.next.codeblocks.org/index.php/topic,10667.msg73032.html#msg73032 )
but i don't understand it, because:
- my english is poor and in this subject the number of developpement are very long and i don't understand that is important.
Can you resume please for me the different step to can see the content of vector<double> , vector<int>, vector<string> ...
thanks a lot!
ps: in debugg mode, I do not know how to look at the contents of variables: i clikck right on variable and i do :
watch"myVariable"
and in the debugg windows i obtain this: MyVariable=No symbol "myVariable" in current context
I suggest you can use a python supported gdb.
If you use windows, see:
http://code.google.com/p/qp-gcc/wiki/GDB
Quote from: ollydbg on May 03, 2011, 10:49:33 AM
I suggest you can use a python supported gdb.
If you use windows, see:
http://code.google.com/p/qp-gcc/wiki/GDB
thank a lot for your help!
i have download the package and i have configurated this step:"Load the python script when Debugger started in Codeblocks" of your page
but after this i always can't see the content of my variables and my vector, other step are necessary?
==> (my english is bad end i am a little beginniner in programmation, this is the reason that it don't understand all)
EDIT:
-for a very simple it's work for double end int type, but it don't work for vector?
-for values close to 0 the debugg show 0 end not 1e-20 !!! it's normal ?
it's work now!!! thank you a lot !!!
just one think:
==> we can't see the content of: vector <vector <double>> ?
if you use the python pretty printing you can.
To disable the C::B pretty printing you should comment the code inside RegisterTypes in the file gdb_types.script.
Quote from: oBFusCATed on May 03, 2011, 08:34:13 PM
if you use the python pretty printing you can.
To disable the C::B pretty printing you should comment the code inside RegisterTypes in the file gdb_types.script.
sorry I'm not good in what file should I do what you say?
(see attached item)
(//)
Why don't you use the search function of your Explorer? :lol:
Quote from: oBFusCATed on May 03, 2011, 09:11:50 PM
Why don't you use the search function of your Explorer? :lol:
:oops: excuse me I had not thought :oops:
( it is here: E:\Program Files\CodeBlocks\share\CodeBlocks\scripts )
But that line i have to modify? i have put in comment all the function " function RegisterTypes(driver) " but my problem is not solve.... :shock:
Hm, my mistake the python pretty printers are broken, too.
Edit: after more testing it seems to work, partly, but the parser is broken. I'm testing with the debugger's branch. Probably 10.05 is even more broken.
Quote from: oBFusCATed on May 03, 2011, 10:27:26 PM
Hm, my mistake the python pretty printers are broken, too.
Edit: after more testing it seems to work, partly, but the parser is broken. I'm testing with the debugger's branch. Probably 10.05 is even more broken.
oK? Thank you for your help. if you find the solution please let me informed
Can you enable the debugger's debug log and paste the output of your debug session?
To enable the log go to Settings -> Compiler & Debugger -> Display debugger's log.
p.s. please use code tags
Quote from: oBFusCATed on May 03, 2011, 11:57:50 PM
Can you enable the debugger's debug log and paste the output of your debug session?
To enable the log go to Settings -> Compiler & Debugger -> Display debugger's log.
p.s. please use code tags
thank you for your help, this is the output of my debugg:
Building to ensure sources are up-to-date
Build succeeded
Selecting target:
Debug
Adding source dir: D:\myProgram\
Adding source dir: D:\myProgram\
Adding file: bin\Debug\myProgram.exe
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb (GDB) 7.2
Child process PID: 5680
Program exited normally.
Debugger finished with status 0
No, it is not.
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Looks like you've not disabled the pretty printers inside C::B!
Quote from: oBFusCATed on May 04, 2011, 01:29:43 PM
No, it is not.
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Looks like you've not disabled the pretty printers inside C::B!
thank you for your help, what is "pretty printers"?
in attached item you have my result (it work for a vector but not for a vector <vector > double > )
and you have my configuration.
Pritty printers are pieces of code which transform the ugly output of gdb in something readable. They hide the implementation details of a vector for example and transform it into something looking like array.
The vector<vector<double>> doesn't work because you have not correctly commented out the function RegisterTypes(driver) function.
thank you for your help
Quote from: oBFusCATed on May 04, 2011, 10:50:44 PM
The vector<vector<double>> doesn't work because you have not correctly commented out the function RegisterTypes(driver) function.
i have already comment this but i have an error when i comment this (you can see attached item)
Comment only the content of the function. C::B is calling it, bug you've removed it.
And please don't attach images to the forum because the space is limited and when there is no more space left, the admins delete attachments at random.
Use some image paste like site -> imageshank, photobucket and the like.
Quote from: oBFusCATed on May 05, 2011, 12:39:40 AM
Comment only the content of the function. C::B is calling it, bug you've removed it.
i do this. Double and vector works but i can't see the content of vector < vector < double > > .... :)
http://img836.imageshack.us/i/debugg.jpg/
As far as I can tell the gdb_types.script is not disabled, still.
I don't know what you've done but it isn't.
[size] = 3
[capacity]=4
[element type] = ......
is printed by this (gdb_types.script) script.
Quote from: oBFusCATed on May 06, 2011, 01:16:06 AM
As far as I can tell the gdb_types.script is not disabled, still.
I don't know what you've done but it isn't.
[size] = 3
[capacity]=4
[element type] = ......
is printed by this (gdb_types.script) script.
Ok, thank you. I think my i did not save the script when i modify then....
now it's OK i think:
http://imageshack.us/photo/my-images/822/debugg.jpg/
http://imageshack.us/photo/my-images/718/scriptxp.jpg/
it works here, see the image:
(http://i683.photobucket.com/albums/vv194/ollydbg_cb/2011-05-06092937.png)
and I think the debug parser has some bug to parse the gdb logs. :D, OBF can look at it.
ok, i don't know why i can't see the same thing...
perhaps i have to modify this:
http://imageshack.us/photo/my-images/638/debugg.jpg/
?
21did21: OllyDbg is using C::B from debugger's branch, that's why it looks different.
OllyDbg: I know. I don't think, I'll fix it soon.
Quote from: oBFusCATed on May 06, 2011, 11:13:11 AM
21did21: OllyDbg is using C::B from debugger's branch, that's why it looks different.
to watch this i do: right click on my vector and "watch"
that is the command to have the "debbuger's branch" ?
thank you for your help :wink:
This is not a command but improved version of C::B...
There is a nightly for it here: http://forums.next.codeblocks.org/index.php/topic,14470.0.html
Quote from: oBFusCATed on May 06, 2011, 05:49:34 PM
This is not a command but improved version of C::B...
There is a nightly for it here: http://forums.next.codeblocks.org/index.php/topic,14470.0.html
OKkkkk :roll:
it's too difficult for me all this thing....
Thank you for your help :D
Now i can watch vector, it's already good