Re: redirect gdbserver stderr/debug vim via gdbserver

Simon Marchi <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
On 2017-03-03 19:09, Matt wrote:
> Hi,
> 
> I am trying to debug a console application  (neovim) with gdbserver.
>  I've tried turning off all debug info from gdbserver (via monitor set
> debug/remote-debug ...), yet I still see "Detaching from process"
> mixed up with the debugged CLI application.

If it's just a cosmetic thing and want to clean up nvim's UI, you can 
type ctrl-L to make nvim redraw it.

I don't think it's possible currently to make gdbserver silent or output 
somewhere else than stderr.  The easiest workaround, if that fits your 
needs, would be to first start nvim and then attach gdbserver from 
another terminal.  e.g.:

   $ gdbserver --once --attach :1234 $(pidof nvim)

If you need to debug a problem that happens at the startup of the 
program, then it's not ideal.  You can always resort to adding a sleep 
at the beginning to give you time to attach, or a while loop on a 
volatile variable that you change from GDB to let the program run.

> In order to make these
> messages disappear, I tried redirecting gdbserver stderr (zsh) to
> 'temp':
> $ gdbserver localhost:7777 ./build/bin/nvim toto 2>temp
> on the other side (same computer) I connect with:
> $ gdb ./build/bin/nvim
> (gdb) target remote :7777
> (gdb) c
> 
> but then nothing appears on the gdbserver terminal, i.e., I can't see
> neovim interface. Why is that ?

I don't know, but I would assume that nvim inherits that redirected 
stderr, maybe that's not good.

Simon
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.