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#12163: 24.1; Can not input anything or showing none output when debugging c/c++ application. Date: Fri, 10 Aug 2012 17:14:14 +0800 Message-ID: References: <83obmkdoli.fsf@gnu.org> <83ehnfdzgw.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d041826eafd8d3e04c6e5c6af X-Trace: dough.gmane.org 1344590159 27046 80.91.229.3 (10 Aug 2012 09:15:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 10 Aug 2012 09:15:59 +0000 (UTC) To: 12163@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 10 11:16:00 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 1SzlK3-0006sa-Ie for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Aug 2012 11:15:59 +0200 Original-Received: from localhost ([::1]:41644 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzlK2-0007G5-L6 for geb-bug-gnu-emacs@m.gmane.org; Fri, 10 Aug 2012 05:15:58 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:45179) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzlJv-0006um-2T for bug-gnu-emacs@gnu.org; Fri, 10 Aug 2012 05:15:55 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SzlJr-0003Dy-Sz for bug-gnu-emacs@gnu.org; Fri, 10 Aug 2012 05:15:50 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36394) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzlJr-0003Dm-Jd for bug-gnu-emacs@gnu.org; Fri, 10 Aug 2012 05:15:47 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SzlRp-0006TF-PX for bug-gnu-emacs@gnu.org; Fri, 10 Aug 2012 05:24:01 -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: Fri, 10 Aug 2012 09:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 12163 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.134459060524830 (code B ref -1); Fri, 10 Aug 2012 09:24:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 10 Aug 2012 09:23:25 +0000 Original-Received: from localhost ([127.0.0.1]:45940 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SzlRE-0006SQ-LC for submit@debbugs.gnu.org; Fri, 10 Aug 2012 05:23:25 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48761) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SzlR8-0006SF-Be for submit@debbugs.gnu.org; Fri, 10 Aug 2012 05:23:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SzlJ6-0002uZ-Le for submit@debbugs.gnu.org; Fri, 10 Aug 2012 05:15:03 -0400 Original-Received: from lists.gnu.org ([208.118.235.17]:49970) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzlJ6-0002uV-I6 for submit@debbugs.gnu.org; Fri, 10 Aug 2012 05:15:00 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:45008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzlJ3-0006TF-RP for bug-gnu-emacs@gnu.org; Fri, 10 Aug 2012 05:15:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SzlJ2-0002tv-Ai for bug-gnu-emacs@gnu.org; Fri, 10 Aug 2012 05:14:57 -0400 Original-Received: from mail-wi0-f177.google.com ([209.85.212.177]:59951) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzlJ2-0002tq-0K for bug-gnu-emacs@gnu.org; Fri, 10 Aug 2012 05:14:56 -0400 Original-Received: by wibhn17 with SMTP id hn17so190041wib.12 for ; Fri, 10 Aug 2012 02:14:55 -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=nGCrj9llSNBlwz0jertXIyoffh9kDlQYHVgoBU1J71I=; b=nWppH5ehIEXU3bylsrm45j/EoMBWkOxSD4VXKTXTj5KZQoYeAQvNiNBTbwfHyqpY6k GDxKXZJlVQN6FmQ1PcXB1OyjR1ZuQJJmF9rhW/ahFvURtLa/J8ZqKMmZ43TCVszY659H B6mQP1mDNr1GfkImu7vIueAtS/T9SnDRXEqxMdG09siq3XaYz5wmRLOHdyIBpuDfqqm0 WCySZh2alvbR+tVJDgc9Uq9YUnZUcf7AoCAhIPiQEMFJQAv8vuMSRsZcHywi051TSFu0 uAYcYYAyKxfgvXpH2S+yq5vFDkn+SEy1pUmw1b4Cgz7HkCxaG5CIOFIBaJaTHc88nxDt j+0g== Original-Received: by 10.180.82.39 with SMTP id f7mr4551863wiy.2.1344590095158; Fri, 10 Aug 2012 02:14:55 -0700 (PDT) Original-Received: by 10.216.210.19 with HTTP; Fri, 10 Aug 2012 02:14:14 -0700 (PDT) In-Reply-To: <83ehnfdzgw.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:62993 Archived-At: --f46d041826eafd8d3e04c6e5c6af Content-Type: text/plain; charset=ISO-8859-1 2012/8/10 Eli Zaretskii > [Please keep the bug address in the CC list.] > Sorry,it's my first time to file a bug report here. I will do as what you > said. > > From: qq510371827 > > Date: Fri, 10 Aug 2012 10:58:11 +0800 > > > > Thanks for your help.But it doesn't work yet. I added : > > setbuf(stdin,NULL); > > setbuf(stdout,NULL); > > or, > > setvbuf(stdin,NULL,_IONBF,0); > > setvbuf(stdout,NULL,_IONBF,0); > > and > > fflush(stdout) after printf, > > All of the above didn't work, None output when debugging my > application.In > > addition,I can not input values during debugging yet. for instance, > > 1...........scanf("%c",s); > > 2........... > > 3........... > > 4...........i=0; // set breakpoint at this line > > During the debugging,*What is the expected result?* > > It should suspend and wait IO buffer's input values. Then after I input a > > value in IO buffer and press RET it resumed and stopped at line 4 ( it > hit > > the breakpoint). > > *But in fact What happens instead?* > > It run and directly stopped at line 4 and didn't give me a chance to > input > > anything. I still input some values in io buffer and press RET but it > > didn't give me a response. It seems as if the debugger didn't recognize > > emacs' input/ouput IO buffer to be its input/output pipe and still kept > > waitting for input. > > This problem only appeared in emacs 24.1. Emacs 23.4 works very well > > without this problem. > > Try invoking GDB from Emacs like this: > > M-x gud-gdb RET > > If that doesn't help, either, then I'm clueless, sorry. Perhaps > someone else could help. > Thanks for your patience. It finally works. However, two other new problem appeared after using 'gud-gdb'. 1).the code, gdb information and out/input datas mixed together in the same buffer and 'gdb-many-windows' command didn't work any more. 2) You can refer this link: http://stackoverflow.com/questions/9676135/gud-gdb-emacs-24-not-working The same problem as mine. --f46d041826eafd8d3e04c6e5c6af Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
2012/8/10 Eli Zaretskii &l= t;eliz@gnu.org>
[Please keep the bug address in the CC list.]
Sorry,it's my first time to file a bug report here. I will do as what y= ou said.=A0
> From: qq510371827 <qq510371827@gmail.com>
> Date: Fri, 10 Aug 2012 10:58:11 +0800
>
> Thanks for your help.But it doesn't work yet. I added :
> =A0 setbuf(stdin,NULL);
> =A0 setbuf(stdout,NULL);
> or,=A0
> =A0 setvbuf(stdin,NULL,_IONBF,0);
> =A0 setvbuf(stdout,NULL,_IONBF,0);
> and
> fflush(stdout) after printf,
> All of the above didn't work, None output when debugging my applic= ation.In
> addition,I can not input values during debugging yet. for instance, > 1...........scanf("%c",s);
> 2...........
> 3...........
> 4...........i=3D0; // set breakpoint at this line
> During the debugging,*What is the expected result?*
> It should suspend and wait IO buffer's input values. Then aft= er I input a
> value in IO buffer and press RET it resumed and stopped at line 4 ( it= hit
> the breakpoint).
> *But in fact What happens instead?*
> It run and directly stopped at line 4 and didn't give me a ch= ance to input
> anything. I still input some values in io buffer and press RET but it<= br> > didn't give me a response. It seems as if the debugger didn't = recognize
> emacs' input/ouput IO buffer to be its input/output pipe and still= kept
> waitting for input.
> This problem only appeared in emacs 24.1. Emacs 23.4 works very well > without this problem.

Try invoking GDB from Emacs like this:

=A0 M-x gud-gdb RET

If that doesn't help, either, then I'm clueless, sorry. =A0Perhaps<= br> someone else could help.
=A0Thanks for your patience. It = finally works. However, two other new problem=A0appeared=A0after using '= ;gud-gdb'.
1).the code, gdb informat= ion and out/input datas mixed together in the same buffer and 'gdb-many= -windows' command didn't work any more.
2)=A0You can refer this link:
The same problem as mine.
--f46d041826eafd8d3e04c6e5c6af--