User forums > Using Code::Blocks

see content of a vector in debugging

<< < (21/26) > >>

killerbot:

--- Quote from: oBFusCATed on June 16, 2009, 12:49:20 pm ---
--- Quote from: killerbot on June 16, 2009, 12:23:22 pm ---results of my latest experiment.
...
==> works, I see 200 entries of the vector v. And when I send manually the "pvector v" command to gdb, I see all 1000 entries.

--- End quote ---
Hm, that's strange, what is the "[size] = ???" value in the watch?

--- End quote ---

It doesn't show the size, shows only [0] to [199] !!!

killerbot:
another experiment. I renamed (alias for remove ;-)  ) the "stl-views-1.0.3.gdb" which resided in the CB-data directory.
Result on the test case (the v vector)

* still see 200 entries !!!!!!!!!!
* pvector unknown command

When giving it back the original name :
* still see 200 entries !!!!!!!!!!
* pvector known command, and pvector v prints out all 1000 entries


Is there something magical in the debugger script ??


Question :
 - can that debugger script be finalized and if possible the bug fixed where the type (int* where i should be int) be fixed, then I would commit it, together with the change in gdbdriver.cpp.
Later on I will add that 'stl-views-1.0.3.gdb file.

oBFusCATed:
That is the problem line:

line 94:      whatis $arg0._M_impl._M_start

It shows what _M_start is ... an array, but do we care for it? We don't show it in the watch, but we can and we can remove the * from it in the squirrel script.

About you problems:
1. what gcc and gdb you are using? (mine gcc 4.3.3 and gdb 6.8, if you gcc is older or newer that might cause problems (I'll try to test it with my other gcc, version 4.1.2)
2. in gdb_types.script on line 169 add "Log(_T("size is " + size);" and look in the log if for "size is 200" strings.

Edit: gcc 4.1.2 works

Edit2: how many stl-views files do you have on your machine?

oBFusCATed:

--- Quote from: oBFusCATed on June 16, 2009, 10:57:14 pm ---That is the problem line:

line 94:      whatis $arg0._M_impl._M_start

--- End quote ---

Found a solution -> the line should be "whatis *$arg0._M_impl._M_start "

oBFusCATed:
I've modified gdb_types.script:

1. The element type is show for vectors.
2. tointeger is replaced with wxString_ToLong, so no modifications are needed
3. removed a debugging Log call

here is the patch: http://smrt.is-a-geek.org/codeblocks/gdb_types.script

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version