From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: gdb fails to flush output (msys2) Date: Mon, 14 Mar 2022 20:40:52 +0200 Message-ID: <834k40js23.fsf@gnu.org> References: <86y21caikh.fsf@csic.es> <83o828k6a7.fsf@gnu.org> <867d8wa05w.fsf@csic.es> <837d8wjsur.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1034"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: juanjose.garciaripoll@gmail.com Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Mar 14 19:42:05 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nTpdr-000Ae1-HQ for ged-emacs-devel@m.gmane-mx.org; Mon, 14 Mar 2022 19:42:03 +0100 Original-Received: from localhost ([::1]:38428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nTpdq-0001Q8-0X for ged-emacs-devel@m.gmane-mx.org; Mon, 14 Mar 2022 14:42:02 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:54326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nTpcw-0000ck-8y for emacs-devel@gnu.org; Mon, 14 Mar 2022 14:41:06 -0400 Original-Received: from [2001:470:142:3::e] (port=48584 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nTpcw-0001V5-0L; Mon, 14 Mar 2022 14:41:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=SvjMbUNwO7P4t+caj+I2goW358vmNoiLtpHXLfp7PoE=; b=n0G+KOJp2GdN +NJno7Af7+VhqqN0YD955B4PxPReu3OabExMswD7KkSvFQ4SuXOQ98C+xfibR9InE4GINAMumG6g1 7RJiVjHxYjI1yoV3/tysk4je9Ves75gf6e2m32O4LS0hCBt4Ati7IjQg8d0+ozMFZoITCUclCp2OI NR7Ytc99mP8OKqFGhgl1QHSl7+QGFUPwPF/nb1lq2R8QYwrpa72A+fdzpwJrFqjxnSukn1ou54G0y L5d+1Pr1ZQtPLN38I2dydDAefY+pMX1QWYIrMWV5K5bq3Os8+WV0IUH1+uj0LnxdBrVzKGRiNPfEZ 5RBHepdWmNkr+tvx7pJQdg==; Original-Received: from [87.69.77.57] (port=1933 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nTpcv-00046O-G0; Mon, 14 Mar 2022 14:41:05 -0400 In-Reply-To: <837d8wjsur.fsf@gnu.org> (message from Eli Zaretskii on Mon, 14 Mar 2022 20:23:40 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:287164 Archived-At: > Date: Mon, 14 Mar 2022 20:23:40 +0200 > From: Eli Zaretskii > Cc: emacs-devel@gnu.org > > > Starting program: c:\home\juanjo\src\tensor\build-msys2-ucrt64\tests\test_rand.exe > > [New Thread 9944.0x1a28] > > [New Thread 9944.0x28c0] > > [New Thread 9944.0x3a00] > > <--- Here it stops. If I press it shows the console output. > > This seems to indicate that there's some incompatibility between the > way GDB outputs stuff to its stdout and the device/program which > displays that stuff. I don't yet understand well enough what you are > doing differently from the "usual" use of GDB on MS-Windows (which > works just fine), so I cannot tell anything more intelligent. UCRT > may or may not be a part of the problem, but I don't have any > experience with using Windows programs linked against UCRT instead of > MSVCRT. One possible issue could be with buffering. Maybe the program you debug uses line buffering for its output, and that somehow need the extra Enter? Just a thought; needless to say, I see no such problems when I debug from Emacs on. Can you show how that program behaves when invoked from the system shell, not under the debugger? Also, if you invoke "M-x shell" inside Emacs, and then run that program from the inferior shell, does it behave correctly, or does it also hangs until you type Enter?