From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii 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: Sun, 12 Aug 2012 20:56:38 +0300 Message-ID: <83has86lk9.fsf@gnu.org> 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> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: dough.gmane.org 1344794264 883 80.91.229.3 (12 Aug 2012 17:57:44 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 12 Aug 2012 17:57:44 +0000 (UTC) Cc: 12180@debbugs.gnu.org To: qq510371827 , Nick Roberts Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Aug 12 19:57:44 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 1T0cQ1-0004uW-R5 for geb-bug-gnu-emacs@m.gmane.org; Sun, 12 Aug 2012 19:57:41 +0200 Original-Received: from localhost ([::1]:40999 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0cQ0-00066V-QX for geb-bug-gnu-emacs@m.gmane.org; Sun, 12 Aug 2012 13:57:40 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0cPx-00066N-Cw for bug-gnu-emacs@gnu.org; Sun, 12 Aug 2012 13:57:39 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T0cPv-0000IO-AL for bug-gnu-emacs@gnu.org; Sun, 12 Aug 2012 13:57:37 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42039) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0cPv-0000IK-70 for bug-gnu-emacs@gnu.org; Sun, 12 Aug 2012 13:57:35 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1T0cY6-0000H6-Fy for bug-gnu-emacs@gnu.org; Sun, 12 Aug 2012 14:06:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 12 Aug 2012 18:06:02 +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: Original-Received: via spool by 12180-submit@debbugs.gnu.org id=B12180.1344794713996 (code B ref 12180); Sun, 12 Aug 2012 18:06:02 +0000 Original-Received: (at 12180) by debbugs.gnu.org; 12 Aug 2012 18:05:13 +0000 Original-Received: from localhost ([127.0.0.1]:51584 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T0cXI-0000G1-P7 for submit@debbugs.gnu.org; Sun, 12 Aug 2012 14:05:13 -0400 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:34093) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1T0cXG-0000Fs-3A for 12180@debbugs.gnu.org; Sun, 12 Aug 2012 14:05:11 -0400 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0M8N00M00LU6A300@a-mtaout23.012.net.il> for 12180@debbugs.gnu.org; Sun, 12 Aug 2012 20:56:39 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M8N00L4YLUDXUF0@a-mtaout23.012.net.il>; Sun, 12 Aug 2012 20:56:37 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il 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:63076 Archived-At: > 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.