Re: How to write to stderr/stdout of debuggee

Konstantin Kharlamov via Gdb <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
On Mon, 2023-11-13 at 10:47 -0700, Tom Tromey wrote:
> > > > > > Konstantin Kharlamov via Gdb <[email protected]> writes:
> 
> > My usecase is I'm debugging some plugin written in Go, and I don't
> > have
> > anything language related in the visibility scope to be able to
> > write
> > to stderr/stdout. Though apparently gdb does see a `write` function
> > (which I presume is a C write function, not Go), but executing a
> 
> > 	p (int) write(2, "Hello", 6)
> 
> > gives me a `syntax error in expression`. So anyway, I'm just
> > wondering
> > if there's some built-in way to do that. I don't see a built-in
> > $_write
> > function in gdb :(
> 
> It's possible you have gdb in 'go' language mode.
> Try 'set language c' before that print.  It might help.
> 
> Tom

Haha, thanks, that worked!
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.