Jump to content
Fabrizio The Cat

CPP builder 12.1 CE: Debug problem

Recommended Posts

Hi all,

after several days of problem debugging a large project, i decided to simplify my life.

 

So i ha have created a new project with the default form only.

Put on it a button and a label.

The button code is:

 

{

int a =1;

int b;

int c;

 

 b=2;

 

c=a+b:

label1->Caption=c;

}

 

a breakpoint on 'b=2' row

The ide when in debug mode show: 'watch list', 'local variables' and 'Call stack' views

first time: Running the program and pushed the button the program stops;

Adding a, b and c variables to the watch list:

in the watch list: a=1 b=0 c=853538 (seems random)

local variables is completely blank as Call stack

.

pressing F8 -> b = 0 c = 853538

pressing F8 -> b = 0 c = 853538

F9 -> the program continue and show the label and the correct value.

 

Closed the ide, launched again and stopped:

in the watch list all 3 variables are with [Evaluating...] value (don't change after lot of time)

and no changes tracing with F8.

 

As i think it's a local problem, what can i do to have the debugger working?

 

Thanks to all that will help me.

 

Fabrizio

 

Edited by Fabrizio The Cat

Share this post


Link to post

It's possible that the compiler has optimised away most of your code, just leaving it with label1->Caption=3. does the same thing happen if you turn off optimisation?

Share this post


Link to post
2 hours ago, Des101 said:

It's possible that the compiler has optimised away most of your code, just leaving it with label1->Caption=3. does the same thing happen if you turn off optimisation?

Thanks for the answer.

Good idea but in Options -> C++ Compiler -> Optimizations 'Disable all optimizations' is selected.  Just verified.

And this wouldn't affect the blank Call stack view, i suppose nor the watch list unresponsive.

 

I have noted that i can see the values in the watch list clicking right mouse button and then selecting the 'enable all'  menu item (note the watches are all emabled...) but this seems force to refresh the view.

Others ideas?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×