Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Debug problems
Debug problems [message #186604] Thu, 01 March 2007 06:44 Go to next message
Eclipse UserFriend
Originally posted by: eduardo.catarino.edisoft.pt

Hello to all,

I'm starting to use CDT and learnig C++, but I'm having some problems
in Debug mode. When I use the cin for example:

if (!cin.get(ch)){
do something...
}


the program execution just freezes and I'm not able to continue with the
program.

if in the line:

if (!cin.get(ch))

I use the step in (F5) I get the following message:

mi_cmd_var_create: unable to create variable object


Can someone help me???


Best regards
Re: Debug problems [message #186619 is a reply to message #186604] Thu, 01 March 2007 07:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dmsubs.NOSPAM.consertum.com

Well, it is trying to read a character from standard input, so have you tried
inputing something? Hint - find the Console windows associated with your
application and type characters into it. Depending on the mode you have set, you
will probably need to enter a Return to 'send' all enetered characters to your
application.
--
Derek


Eduardo Catarino wrote:
> Hello to all,
>
> I'm starting to use CDT and learnig C++, but I'm having some problems
> in Debug mode. When I use the cin for example:
>
> if (!cin.get(ch)){
> do something...
> }
>
>
> the program execution just freezes and I'm not able to continue with the
> program.
>
> if in the line:
>
> if (!cin.get(ch))
>
> I use the step in (F5) I get the following message:
>
> mi_cmd_var_create: unable to create variable object
>
>
> Can someone help me???
>
>
> Best regards
>
Re: Debug problems [message #186627 is a reply to message #186619] Thu, 01 March 2007 08:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eduardo.catarino.edisoft.pt

Hi Derek,

I tryed to introduce values in both console windows (gdb console and
the workspace console) but it seems that the program is still waiting for
the input... Is there any configuration that I should check?


Best regards,
Eduardo
Re: Debug problems [message #186634 is a reply to message #186627] Thu, 01 March 2007 08:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dmsubs.NOSPAM.consertum.com

I guess you haven't found the right console... The Window that says 'Console'
actually is a stack of consoles - when debugging I have 3 consoles. The one that
says GDB is for communicating with GDB - NOT your application. To cycle through
the consoles press the icon that look like a display screen on the right of
the console window.

Perhaps easist way to find out is to get your program to write something (via
cout) and see which console it displays in. That is the one expecting the input.
--
Derek


Eduardo Catarino wrote:
> Hi Derek,
>
> I tryed to introduce values in both console windows (gdb console and
> the workspace console) but it seems that the program is still waiting
> for the input... Is there any configuration that I should check?
>
> Best regards,
> Eduardo
>
Re: Debug problems [message #186640 is a reply to message #186634] Thu, 01 March 2007 09:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eduardo.catarino.edisoft.pt

Hello Derek,

Ok that is my problem! I can only find 2 consoles. And none of it
display the message that I put in cout ("hello I'm here"). However if I'm
running the progam in the normal mode the message is displayed...

Do you have any ideia wy is this happenning?
Thanks for all your help.

Best regards,
Eduardo
Re: Debug problems [message #186645 is a reply to message #186640] Thu, 01 March 2007 09:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dmsubs.NOSPAM.consertum.com

You'll need to put a "\n" at the end of the cout, else it will get buffered.

In fact, it should read

cout << "hello I'm here\n";

--
Derek


Eduardo Catarino wrote:
> Hello Derek,
>
> Ok that is my problem! I can only find 2 consoles. And none of it
> display the message that I put in cout ("hello I'm here"). However if
> I'm running the progam in the normal mode the message is displayed...
>
> Do you have any ideia wy is this happenning? Thanks for all
> your help.
>
> Best regards,
> Eduardo
>
Re: Debug problems [message #186661 is a reply to message #186645] Thu, 01 March 2007 09:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eduardo.catarino.edisoft.pt

Hello Derek,

I added the '\n' at the end of the sentence but I'm still no able to
introduce values in the cin in debug mode or either display anything in
the console (cout).
Any ideias, for what more to check? This should be a simple task but
I realy don't know what is going wrong...

Best regards,
Eduardo
Re: Debug problems [message #186684 is a reply to message #186661] Thu, 01 March 2007 10:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dmsubs.NOSPAM.consertum.com

Sorry, no more ideas.

Are you sure that:
1. you are using
cout << "message\n" ;
before you cin?
2. you are looking at the right console?

--
Derek


Eduardo Catarino wrote:
> Hello Derek,
>
> I added the '\n' at the end of the sentence but I'm still no able
> to introduce values in the cin in debug mode or either display anything
> in the console (cout).
> Any ideias, for what more to check? This should be a simple task
> but I realy don't know what is going wrong...
>
> Best regards,
> Eduardo
>
Re: Debug problems [message #186692 is a reply to message #186684] Thu, 01 March 2007 10:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eduardo.catarino.edisoft.pt

About 1) Yes I used the \n
About 2) I looked at the 2 consoles available but none of it displayed the
message. Is there any debug parameter that I should look? (I'm using the
Cygwin gdb)

In any case thanks a lot for your hints.

Best Regards,
Eduardo
Re: Debug problems [message #186722 is a reply to message #186692] Thu, 01 March 2007 12:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eduardo.catarino.edisoft.pt

Thanks Derek.

I found the console... but it was outside the Eclipse, in a cmd (dos)
window...
Can I redirect this window to one of the consoles inside Eclipse.

Best regards,
Eduardo
Re: Debug problems [message #186814 is a reply to message #186722] Thu, 01 March 2007 13:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dmsubs.NOSPAM.consertum.com

Hmm, Which version of Eclipse/CDT are you using? Also, which version of GDB? On
my system, it happens 'automatically'.
--
Derek


Eduardo Catarino wrote:
> Thanks Derek.
>
> I found the console... but it was outside the Eclipse, in a cmd (dos)
> window...
> Can I redirect this window to one of the consoles inside Eclipse.
>
> Best regards,
> Eduardo
>
Re: Debug problems [message #186890 is a reply to message #186814] Fri, 02 March 2007 09:12 Go to previous message
Eclipse UserFriend
Originally posted by: eduardo.catarino.edisoft.pt

Hello Derek,

Sorry but yesterday I was unable to answer you.
I'm using Eclipse SDK Version: 3.2.2 with the latest CDT version.
I'm running Eclipse under Windows XP and using the latest version of
Cygwin.
Is there any configuration parameter that I should check.

Thanks in advance,
Eduardo Catarino
Previous Topic:memory problem--keep growthing use of memory
Next Topic:updated cygwin - now getting source not found
Goto Forum:
  


Current Time: Fri Aug 29 04:09:40 EDT 2025

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

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

Back to the top