Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Konstantin Kharlamov via Gdb <gdb@sourceware.org>
To: gdb@sourceware.org
Subject: How to write to stderr/stdout of debuggee
Date: Fri, 10 Nov 2023 18:06:31 +0300	[thread overview]
Message-ID: <9c035c4b1eeca774df605fda412570a9bb151a59.camel@yandex.ru> (raw)

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 :(

P.S.: please keep me in CC, I'm not a list subscriber

             reply	other threads:[~2023-11-10 15:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-10 15:06 Konstantin Kharlamov via Gdb [this message]
2023-11-13 17:47 ` Tom Tromey
2023-11-13 18:10   ` Konstantin Kharlamov via Gdb

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=9c035c4b1eeca774df605fda412570a9bb151a59.camel@yandex.ru \
    --to=gdb@sourceware.org \
    --cc=Hi-Angel@yandex.ru \
    /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