Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Watch expression in C/C++ Project is possible??
Watch expression in C/C++ Project is possible?? [message #817749] Sat, 10 March 2012 10:41 Go to next message
Eclipse UserFriend
Hi!!

I'm try to view the result of a "if" sentence, but I don't know how to do. Confused
Is possible do this in C Project or.. is only for Java Project?

Regards and sorry for my very bad English! Embarrassed
Re: Watch expression in C/C++ Project is possible?? [message #819081 is a reply to message #817749] Mon, 12 March 2012 09:19 Go to previous messageGo to next message
Eclipse UserFriend
Please, anyone can help me??
I want known the result of this sentence, for example:

if(i==5)
{
     break;
}
Re: Watch expression in C/C++ Project is possible?? [message #819105 is a reply to message #819081] Mon, 12 March 2012 09:50 Go to previous messageGo to next message
Eclipse UserFriend
Hi,
I don't see what you mean saying "the result of a 'if' sentence".

For your example, this code is useless, the 'break' will put you out of the 'if' sequence.

Could you be more accurate about what you expect to do?

Maybe you should have a look at the Breakpoint?

[Updated on: Mon, 12 March 2012 09:52] by Moderator

Re: Watch expression in C/C++ Project is possible?? [message #819245 is a reply to message #819105] Mon, 12 March 2012 13:10 Go to previous messageGo to next message
Eclipse UserFriend
Sorry for my bad explanation.

I want see if a condition sentence is true or false (in the debugger at run time, obviously!).
New example:
int i;
cin << i;
if(i == 5) // I want see if this condition return true or false at runtime.
{
    cout << "This is the number secret!! :)"
}
else
{
    cout << "Sorry, try again! :("
}
Re: Watch expression in C/C++ Project is possible?? [message #819738 is a reply to message #819245] Tue, 13 March 2012 05:14 Go to previous messageGo to next message
Eclipse UserFriend
You may add some BreakPoint into your then and else statement.
You just have to right click on the column where markers are shown and use 'Toggle Breakpoint'. There will be a blue point facing the line.
Then, you run a debug, and the execution will normally stop when it reaches the line containing the breakpoint.
In the debug view, you could see all the environment there is during the execution.

Hope it helps,
Fabien
Re: Watch expression in C/C++ Project is possible?? [message #819796 is a reply to message #819245] Tue, 13 March 2012 06:38 Go to previous message
Eclipse UserFriend
Carlos Solano wrote on Mon, 12 March 2012 18:10
Sorry for my bad explanation.

I want see if a condition sentence is true or false (in the debugger at run time, obviously!).
New example:
int i;
cin << i;
if(i == 5) // I want see if this condition return true or false at runtime.
{
    cout << "This is the number secret!! :)"
}
else
{
    cout << "Sorry, try again! :("
}

So you want a conditional breakpoint? Set a breakpoint and then open the context menu of the breakpoint (right click on the blue circle) and choose "Breakpoint properties..."
Previous Topic:libxml2
Next Topic:How to edit makefile in Eclipse GUI
Goto Forum:
  


Current Time: Tue Jun 17 14:16:23 EDT 2025

Powered by FUDForum. Page generated in 0.04972 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top