User forums > Using Code::Blocks

see content of a vector in debugging

<< < (20/26) > >>

oBFusCATed:
Another thought that have come to my mind is that we need to skip the registration of the "Stl Vector debugger script" when the stl_debugging_enabled is false, so the user won't see the squirrel execution error or something similar.

killerbot:
well I would try without the enable flag at first, when it is working ok (in future that script will be present), I don't think we should make it enable/disable. Since for real debugging you want this. Other IDE's show the vectors out of the box, they also don't allow to enable/disable. We just have to make sure it does not have negative side effects ;-)

When it works this is the things to adjust in CB :
1) new debugger script
2) add the .gdb file
3) change the code to source it
...
...
4) further improve on the offered functionalities :-)

killerbot:
now I have something really strange.
I removed my previous code (the code from yesterday, now on my linux box), the v vector is shown (only 200 entries), but when I issue manually pvector, it claims the command is unknown. Strange ...

killerbot:
results of my latest experiment.

* in CB debugger settings : no source init commands anymore
* mofdified "gdb_types.script"
* stl-views-1.0.3.gdb  @ /usr/local/share/codeblocks
* code change in gdbdriver.cpp::GDB_driver::Prepare()

--- Code: ---    // define all scripted types
    m_Types.Clear();
    InitializeScripting();

    wxString StlDebugCommand(_T("source $DATAPATH/stl-views-1.0.3.gdb"));
    Manager::Get()->GetMacrosManager()->ReplaceMacros(StlDebugCommand);
    QueueCommand(new DebuggerCmd(this, StlDebugCommand));

    // pass user init-commands

--- End code ---

==> 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.

One strange thing :

--- Code: ---elem[997]: $998 = 997
elem[998]: $999 = 998
elem[999]: $1000 = 999
Vector size = 1000
Vector capacity = 1024
Element type = int *
--- End code ---

element type --> int * , shouldn't this be int ?

oBFusCATed:

--- 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?


--- Quote from: killerbot on June 16, 2009, 12:23:22 pm ---One strange thing :

--- Code: ---elem[997]: $998 = 997
elem[998]: $999 = 998
elem[999]: $1000 = 999
Vector size = 1000
Vector capacity = 1024
Element type = int *
--- End code ---

element type --> int * , shouldn't this be int ?

--- End quote ---
Yes, this seems to be a bug in the script

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version