From: Konstantin Kharlamov via Gdb <gdb@sourceware.org>
To: Tom Tromey <tom@tromey.com>,
Konstantin Kharlamov via Gdb <gdb@sourceware.org>
Subject: Re: How to write to stderr/stdout of debuggee
Date: Mon, 13 Nov 2023 21:10:04 +0300 [thread overview]
Message-ID: <b043c3f2c3ca1c5197da58ec60cb5fa8a8c9b849.camel@yandex.ru> (raw)
In-Reply-To: <877cmlsfyo.fsf@tromey.com>
On Mon, 2023-11-13 at 10:47 -0700, Tom Tromey wrote:
> > > > > > 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
Haha, thanks, that worked!
prev parent reply other threads:[~2023-11-13 18:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-10 15:06 Konstantin Kharlamov via Gdb
2023-11-13 17:47 ` Tom Tromey
2023-11-13 18:10 ` Konstantin Kharlamov via Gdb [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b043c3f2c3ca1c5197da58ec60cb5fa8a8c9b849.camel@yandex.ru \
--to=gdb@sourceware.org \
--cc=Hi-Angel@yandex.ru \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox