How to write to stderr/stdout of debuggee
Tom Tromey
tom@tromey.com
Mon Nov 13 17:47:27 GMT 2023
>>>>> Konstantin Kharlamov via Gdb <gdb@sourceware.org> 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
More information about the Gdb
mailing list