Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: hqt on August 09, 2011, 07:04:05 pm

Title: Debug an Array
Post by: hqt on August 09, 2011, 07:04:05 pm
I am trying to use Code::Block, But I still get some problem like when I'm using DevC++. In Watch Windows, I want to see A array. (example: int A[5][5]). but in debug windows, I will appear from top to down:
Code
A[1][1]
A[1][2]
...
A[5][5]
This style is to difficult for me to trace an Double Array. I want to view like Free-Pascal:
Code
A[1][1] A[1][2] A[1][3]...
A[2][1] A[2][2] A[2][3]...
....
A[5][1] A[5][2] A[5][3]...
Who know this problem, please answer to me please :(

thanks for all :)
Title: Re: Debug an Array
Post by: oBFusCATed on August 09, 2011, 10:32:37 pm
What? ... Computing ... Cannot compute...

Seriously why are you using C/C++, but you want it to behave like Pascal?
Title: Re: Debug an Array
Post by: zabzonk on August 09, 2011, 10:58:41 pm
> Seriously why are you using C/C++, but you want it to behave like Pascal?

I don't think he wants it to behave like Pascal, just to be displayed in a slightly more user-friendly and/or space-saving way. 
Title: Re: Debug an Array
Post by: ollydbg on August 10, 2011, 04:28:34 am
Not sure how OP did, but it works OK. (BTW: array index should start from 0, not 1 in C/C++)
see the screen shot in the watch window:
(http://i683.photobucket.com/albums/vv194/ollydbg_cb/2011-08-10102241.png)
Title: Re: Debug an Array
Post by: hqt on August 10, 2011, 05:01:12 am
Oh, It's very nice and very clear to debug. But how can you do that, please tell to me please.
 (In your pictures, I seems You run on Redhat/Linux, But I'm using Code::Block on Windows, so I don't know if there are some different points between these version)
thanks:)
Title: Re: Debug an Array
Post by: ollydbg on August 10, 2011, 05:11:36 am
In your pictures, I seems You run on Redhat/Linux, But I'm using Code::Block on Windows
I'm using C::B under Windows XP.
Please try a nightly build C::B, such as:
http://forums.codeblocks.org/index.php/board,20.0.html
(choose the debugger branch version, which has more debug feature improved)
Title: Re: Debug an Array
Post by: hqt on August 10, 2011, 05:55:49 am
Oh, thanks very much :) I can use Code::Block Nightfall and the Debugger is nice :)
But I have an other question: my computer now have two version of Code::Block: first is normal and second is Nightfall version. Can I delete normal version (and this action will not take any damage to other part) ?
Title: Re: Debug an Array
Post by: MortenMacFly on August 10, 2011, 06:47:30 am
Can I delete normal version (and this action will not take any damage to other part) ?
Yes. You should (however) also delete the config file "default.conf" in %APPDATA%\codeblocks. This will basically initialise C::B from scratch.
Title: Re: Debug an Array
Post by: Raisolution on August 05, 2012, 01:18:05 am
Hello,
I am a new CB user and recently downloaded the latest CB nightly build, hoping for a better debugger. Actually it's worse. It don't have autos and locals and I don't get the arrays visualized like on the screenshot (it just shows the address). How to configure it to be like the one on the screenshot?

Thanks in advance!
Title: Re: Debug an Array
Post by: oBFusCATed on August 05, 2012, 08:11:33 pm
For arrays:
1. Right click on the watch -> properties
2. Enable watch as array
3. Set first element and count
Title: Re: Debug an Array
Post by: dalanz on August 10, 2012, 10:36:50 am
I have the same problem. I want to debug an array, and I'm not able to see it.

I've installed Ubuntu 12.04 LTS, and Code::Blocks 10.05. I tried to use the nightly version, but I can only open the program with Wine (inserted dll files).

How can I see the array when I'm debugging? Besides, a message appears in the console when I start. It says: "warning: GDB: Failed to set controlling terminal: Invalid argument"

P.S: I am a new user with Ubuntu and Code::Blocks :-)
Title: Re: Debug an Array
Post by: oBFusCATed on August 10, 2012, 10:52:48 am
I've installed Ubuntu 12.04 LTS, and Code::Blocks 10.05. I tried to use the nightly version, but I can only open the program with Wine (inserted dll files).
What about reading a few posts (most of the time the second post) below the first post in a nightly topic and then use the proper way to install it on ubuntu?