emacs-devel
[Top][All Lists]
Advanced

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

Re: gdb fails to flush output (msys2)


From: Eli Zaretskii
Subject: Re: gdb fails to flush output (msys2)
Date: Mon, 14 Mar 2022 15:33:36 +0200

> From: Juan José García-Ripoll
>  <juanjose.garciaripoll@gmail.com>
> Date: Mon, 14 Mar 2022 12:18:22 +0100
> 
> I am trying to debug some programs on Windows using MSYS2.

What do you mean by "using MSYS2" here?

> In doing so, I noticed that the gdb mode is not working well with
> the output from the debugger.

By "gdb mode", do you mean the result of "M-x gdb", followed by
specifying the GDB command line to debug a program?  If so, what was
the GDB command line you used?

> Specifically, when I start the debugger I get the expected prompt. I can
> also issue simple commands, such as "help", or "target exec". However,
> once I press run and my program executes, the output from the program is
> withheld.

What program are you debugging?  Is it a native MS-Windows
(a.k.a. "MinGW") program, or is it an MSYS2 program that depends on
the MSYS DLL?  Also, is it a console program or something else, like a
program using curses or some other unusual methods of writing to the
screen?

> GDB is currently invoked through a wrapper I set up to find the
> executable https://github.com/juanjosegarciaripoll/project-cmake
> However, the same problem is witnessed with a modern installation of
> MSYS2 and this little elisp script:
> 
> (let* ((msys2 "C:/msys64/ucrt64/bin")
>          (path (concat msys2 ";" (getenv "PATH")))
>          (default-process-coding-system 'utf-8-unix)
>          (process-environment (cl-list* (concat "PATH=" path)
>                                                                         
> "MSYSTEM=ucrt64"
>                                                                         
> process-environment)))
>   (call-interactively #'gdb))

What happens if you manually add "C:/msys64/ucrt64/bin" to PATH
outside of Emacs, and then invoke GDB from the Windows Command Prompt
window to debug that same program -- does that work as expected?



reply via email to

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