User forums > General (but related to Code::Blocks)

Aparent error in Code Blocks

(1/2) > >>

venom4u31:
I was writing a program in code blocks and I have stumbled upon this error... I ran the program execution just after the initialization of s1 and s2 and although s2 is called just like s1 in the watch window, it has a totally different value than it should have.
s1 and s2 are not global or declared in any other function of this project. In this example j=0, d=1;


Can you please tell me any possible reason for which s1 and v->v+j+d have different values but identical addresses? I can't think of any. There you have a descriptive image (I can assure you it's not edited):

stahta01:
Use the command line debugger.
Verify the problem either exists or does not exist using the command line debugger.

POST Information regarding your setup.
CB Version
OS Name and version
Compiler version
Debugger version

Tim S.

venom4u31:
The Code Blocks Version is 10.05
The OS is Windows 7 32 bits
The compiler is GNU GCC but I don't know how to find its version.
The debugger name and version is GNU gdb 6.8

I don't know how to verify if a problem exists using the command line debugger, I know about the existence of the problem when I am seeing that two pointers point to the same address and their value greatly differs.

Also, I noticed that there are two commas after *((int*)v->v+j+d) = 23,, and v->v+j+d = (void *) 0x22fea9,,. Could that mean anything?

stahta01:
Can someone else help this poster; I really do not used debug enough to help them.

The thinks stated in debug threads are:

Turn on debug logging (I have no idea how to do.)
Use the debug nightly build. http://forums.codeblocks.org/index.php/board,20.0.html
Verify the problem exists on the command line as stated in past.
Upgrade/downgrade the gdb version (no idea which version work best.)

Tim S.

ollydbg:
@OP
Please post your code snippet so that I can test it.

In fact, I'm not fully understand what's OP's problem, what is the watch expression, and what's the exact value it should be? Please list them.

Navigation

[0] Message Index

[#] Next page

Go to full version