public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* debugger-only log on Linux, equivalent of OutputDebugString
@ 2020-09-17  8:48 A. M. Miera
  2020-09-17 17:10 ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: A. M. Miera @ 2020-09-17  8:48 UTC (permalink / raw)
  To: gdb

Hello,

I've been recently looking for sth equivalent of Windows's 
OutputDebugString for Linux.
Fiddling with built-in python, I have managed to create a named pipe 
that GDB would read in the background (via python), while the inferior 
writes to it (using some simple API, which I have currently implemented 
as a shared lib).

Despite being in early prototype stage (with all its problems) my code 
works.
The main question I'd like to ask though, is this: is that actually the 
right way to go, or can this be done better in terms of operation 
principles? I have several concerns here:
a. this might be very system-specific, e.g. for bare-metal Cortex-Mx 
targets there's sth called "semihosting", which effectively does the 
same (though is something different in principle). Windows already its 
own call, too, etc.
b. most likely a simple pipe-based solution is not going to work with 
remote targets, e.g. gdbserver? Should it be added?
c. and last but not least: maybe a mechanism already exists and I'm 
reinventing the wheel now?

If someone wants to have a look, the code's here (again, please keep in 
mind it's just proof of concept, not production quality):
https://gitlab.com/alagner/gdbprint

Looking forward to hear all the criticism on the idea.

Best regards,
Aleksander "Alagner" Miera

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-17 19:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-17  8:48 debugger-only log on Linux, equivalent of OutputDebugString A. M. Miera
2020-09-17 17:10 ` Tom Tromey
2020-09-17 19:01   ` Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).