help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

xemacs, gdb, I can't input from the terminal in main function, but other


From: davinci
Subject: xemacs, gdb, I can't input from the terminal in main function, but others functions well.
Date: 8 Sep 2005 03:33:05 -0700
User-agent: G2/0.2

I had study it for a long time .but I didn't solve it .Ihad read
<<Debuging with GDB>>
But I didn't get something useful.
include<iostream>
#include<cstdlib>
using std::isdigit;
int main()
{  int i=4;
 try
   {
     while(1)
       {
         std::cin>>i;
         if(!isdigit(i))
           {
             std::cout<<"not digit ,once more"<<std::endl;
             std::cout<<"i="<<i<<std::endl;
           }
        if(i==2)
           {
             std::cout<<"good boy"<<std::endl;
           }
         else
           {
             std::cout<<"bad boy"<<std::endl;
           }

       }
   }

catch(...)
  {
    std::cout<<"execption had happened"<<std::endl;
  }
}

//end of the codes
 //from here:  std::cin>>i;
(gdb) s     //here ,no chance to input anything.
(gdb) s
(gdb) s
not digit ,once more
(gdb) s
i=4
(gdb) s
(gdb) s
bad boy
(gdb) s   //no chance to input anything,there is no prompt for input.
(gdb) s
(gdb) s
not digit ,once more
(gdb) s
i=4
(gdb)

But I can input something when I am no in the main function.

anyhelp?
thanks very much.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]