From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: qq510371827 Newsgroups: gmane.emacs.bugs Subject: bug#12180: bug#12163: 24.1; Can not input anything or showing none output when debugging c/c++ application. Date: Mon, 13 Aug 2012 22:00:33 +0800 Message-ID: References: <83obmkdoli.fsf@gnu.org> <83ehnfdzgw.fsf@gnu.org> <837gt7dqjm.fsf@gnu.org> <83628qeikl.fsf@gnu.org> <83obmhcxfz.fsf@gnu.org> <83lihlcsmu.fsf@gnu.org> <83has86lk9.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d0442820e77c9f904c726207f X-Trace: dough.gmane.org 1344866574 31461 80.91.229.3 (13 Aug 2012 14:02:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 13 Aug 2012 14:02:54 +0000 (UTC) To: eliz@gnu.org, 12180@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 13 16:02:52 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T0vEE-0003lN-7m for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 Aug 2012 16:02:46 +0200 Original-Received: from localhost ([::1]:49693 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0vED-0006Gn-Bf for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 Aug 2012 10:02:45 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40416) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0vE5-00061B-O8 for bug-gnu-emacs@gnu.org; Mon, 13 Aug 2012 10:02:41 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T0vDx-00011Z-Uw for bug-gnu-emacs@gnu.org; Mon, 13 Aug 2012 10:02:37 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:43997) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0vDx-00011S-S9 for bug-gnu-emacs@gnu.org; Mon, 13 Aug 2012 10:02:29 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1T0vME-0005wx-3C for bug-gnu-emacs@gnu.org; Mon, 13 Aug 2012 10:11:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: qq510371827 Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 Aug 2012 14:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12180 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: Eli Zaretskii , bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.134486702022804 (code B ref -1); Mon, 13 Aug 2012 14:11:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 13 Aug 2012 14:10:20 +0000 Original-Received: from localhost ([127.0.0.1]:53539 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T0vLV-0005vj-QJ for submit@debbugs.gnu.org; Mon, 13 Aug 2012 10:10:19 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51872) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T0vLS-0005vb-7k for submit@debbugs.gnu.org; Mon, 13 Aug 2012 10:10:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T0vD5-0000tK-PR for submit@debbugs.gnu.org; Mon, 13 Aug 2012 10:01:41 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:57801) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0vD5-0000tC-Mi for submit@debbugs.gnu.org; Mon, 13 Aug 2012 10:01:35 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40029) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0vCw-0005Rb-2z for bug-gnu-emacs@gnu.org; Mon, 13 Aug 2012 10:01:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T0vCm-0000qI-4n for bug-gnu-emacs@gnu.org; Mon, 13 Aug 2012 10:01:26 -0400 Original-Received: from mail-wi0-f171.google.com ([209.85.212.171]:37939) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0vCl-0000pq-RV; Mon, 13 Aug 2012 10:01:16 -0400 Original-Received: by wibhq4 with SMTP id hq4so2706768wib.12 for ; Mon, 13 Aug 2012 07:01:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=WBK0Yfffv5p085IThE13t72ONAb7kLjhh65bF2i3NB8=; b=SES5j+JrpjrVSJA+Kf02a4Dqdnbn7g6zbCiG3TsFgQtmLv4+IpFgHC+s8mBzzADXUA ep46KdQjqiR5FQQ0qGvRE3VgzBTV+1GlvXZ9Ad7lBcJrbU54CStNpUOX+neM2YDf9ic/ UsXS3z0L/ImDBBrqKNVEKtOAdAGDcb86aDG+UklUNyoUK2K2S8O+EfZ08tAFlM+o6st6 1KzMcryP/rVsDXjbUE/szPoCPthUXUfytrTDabct1pw+aNbd5+KXr1SdyKZanqbFoz+N 5TB30vLbkR0RrTib+6cHvvQGKXMAcHxRPaXU93tM/1NsuENE9Eq7+2JwI63y+R5DF+gB OkEg== Original-Received: by 10.180.86.133 with SMTP id p5mr18755301wiz.17.1344866474248; Mon, 13 Aug 2012 07:01:14 -0700 (PDT) Original-Received: by 10.216.225.72 with HTTP; Mon, 13 Aug 2012 07:00:33 -0700 (PDT) In-Reply-To: <83has86lk9.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:63101 Archived-At: --f46d0442820e77c9f904c726207f Content-Type: text/plain; charset=ISO-8859-1 ' set new-console on ' command works for me. I have tried eclipse cdt and it also has the same problem as emacs 24.1 on windows with mingw. Strangely, why emacs 23.4 just works? 2012/8/13 Eli Zaretskii > > From: qq510371827 > > Date: Sun, 12 Aug 2012 09:32:14 +0800 > > Cc: 12180@debbugs.gnu.org, bug-gnu-emacs@gnu.org > > > > Yes,I have tried that.Both GUI session and TTY session work very well. > > I guess it's a matter of timing, then: there's a certain race > condition between Emacs that crams commands into GDB and the debuggee > that reads from stdin. If the latter comes after Emacs already sent > all the commands, then the program will work correctly. But that's a > guess; I hope someone knowledgeable about GUD, comint, and gdb-mi will > chime in. Nick? somebody? > > Anyway, I found a work-around for this problem. After entering GDB, > and before running your program, type this command at GDB prompt: > > (gdb) set new-console on > > This will cause GDB to create a separate console window for the input > and output of your program, when you run it, and you can then > communicate with your program without mixing its I/O with that of GDB. > Just be sure to put a breakpoint at the 'exit' call or at the last > line of your 'main' function, if you want to look at the program > output. If you don't do that, the console will be automatically > closed when your program exits. > --f46d0442820e77c9f904c726207f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable '=A0set new-console on=A0' command works for me. I have tried=A0ecl= ipse cdt =A0and it also has the same problem as emacs 24.1 on windows with = mingw. Strangely, why emacs 23.4 just works?
= 2012/8/13 Eli Zaretskii <eliz@gnu.org>
> From: qq510371827 <qq510371827@gmail.com>
> Date: Sun, 12 Aug 2012 09:32:14 +0800
> Cc: 12180@debbugs.gnu.org= , bug-gnu-emacs@gnu.org
>
> Yes,I have tried that.Both GUI session and TTY session work very well.=

I guess it's a matter of timing, then: there's a certain race=
condition between Emacs that crams commands into GDB and the debuggee
that reads from stdin. =A0If the latter comes after Emacs already sent
all the commands, then the program will work correctly. =A0But that's a=
guess; I hope someone knowledgeable about GUD, comint, and gdb-mi will
chime in. =A0Nick? somebody?

Anyway, I found a work-around for this problem. =A0After entering GDB,
and before running your program, type this command at GDB prompt:

=A0 (gdb) set new-console on

This will cause GDB to create a separate console window for the input
and output of your program, when you run it, and you can then
communicate with your program without mixing its I/O with that of GDB.
Just be sure to put a breakpoint at the 'exit' call or at the last<= br> line of your 'main' function, if you want to look at the program output. =A0If you don't do that, the console will be automatically
closed when your program exits.

--f46d0442820e77c9f904c726207f--