User forums > Using Code::Blocks

see content of a vector in debugging

<< < (3/26) > >>

MortenMacFly:

--- Quote from: taram on June 08, 2009, 02:59:59 am ---Also frisch ans Werk - lets start fresh....
[...]
@ Jens: Schön, daß Du meinen Vorschlag aufgegriffen hast bzgl. Deiner HP. 

--- End quote ---
Although we do have German admins please do *not* post in German anymore if there is no particular reason. This is and remains an english-only forum. Thanks.

taram:
?? I do not understand your concerns?? I know this fact, but there was no additional information in the German sentence and furthermore the translations was given directly behind it.

The other sentence was a thankful personal note to jens.

Further the complete discussion about the problem was/is done in English. If it would be done in German you would be right.

However, it was not my intention to disregard the forum rules, so I modified my entries above.

Cheers

Martin  

rcoll:

--- Quote from: taram on June 08, 2009, 02:59:59 am ---Yes, it may be an GDB issue, but I have less knowledge about it.

However may be in a future nightly build this issue will be solved... may be this issue should be forwarded to a "GDB geek" of the Code::Blocks developer crew.

Cheers

Martin


--- End quote ---

No, I doubt it.  The GDB geeks are another group of geeks entirely.  The geeks who develope C::B only use GCC, they don't develope it.  In short, your problem is strictly a GDB problem, not a C::B problem.

I noticed that you never mentioned which version of GCC (and therefore GDB) you are using.  It may be that a newer version has the features you need.

Ringo

taram:
thx ringo for your input. I use

- gcc version 4.3.2 (Debian 4.3.2-1.1,Target: i486-linux-gnu)   -- by $gcc -v
 
- GNU gdb 6.8-debian (This GDB was configured as "i486-linux-gnu".) -- by $gdb -v

I will try to find a deb package for debian lenny and then  update to GCC 4.3.3
   
http://gcc.gnu.org/gcc-4.3/

may be this solve the problem

cheers

Martin




ollydbg:

--- Quote from: jens on June 07, 2009, 10:12:13 am ---You have to use the []-operator in your program, otherwise it gets not compiled in and therefore cannot be used by gdb.

--- End quote ---
Hi, Jens. Thanks for the reply.
I understand now. (Oh, My poor English, I need to read twice of these sentence to understand it's meaning :()
If I define v[0], then gdb can also understand v[1].  :D


--- Code: ---#include <iostream>
#include <string>
#include <vector>

using namespace std;

typedef vector<string> vstr;

int main()
{
    vstr v;
    v.push_back("bla bla");
    v.push_back("abcdef");

    string v0 = v[0];
    cout << "Hello world!" << endl;
    return 0;
}

--- End code ---

See my screen shot.

Edit:
Oh, taram has already mentioned that.

Edit2
If I just add "v" to "watch", then check on the "Watch as array" opiotion. I still can't view any contents. Seems GDB didn't regard "v" as an array beginning address.
We can only use "v[0], v[1]" instead. :D





[attachment deleted by admin]

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version