simon-git: filter (master): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Tue Oct 9 20:28:58 BST 2018
TL;DR:
45fb7c2 Add the recent noprogress filter to .gitignore.
75a26db Move a lot of main.c out into a new mainloop.c.
2b9a5de New utility 'linktty', for non-networked gdbserver.
Repository: https://git.tartarus.org/simon/filter.git
On the web: https://git.tartarus.org/?p=simon/filter.git
Branch updated: master
Committer: Simon Tatham <anakin at pobox.com>
Date: 2018-10-09 20:28:58
commit 45fb7c296cabaa916bc9b5d6dc0486a7fe9469b0
web diff https://git.tartarus.org/?p=simon/filter.git;a=commitdiff;h=45fb7c296cabaa916bc9b5d6dc0486a7fe9469b0;hp=9f6de23534c305c80b9a9964caa9130181667df9
Author: Simon Tatham <anakin at pobox.com>
Date: Tue Oct 9 18:53:02 2018 +0100
Add the recent noprogress filter to .gitignore.
.gitignore | 1 +
1 file changed, 1 insertion(+)
commit 75a26dbe0f49951ac3a298cbad1cc80360b22335
web diff https://git.tartarus.org/?p=simon/filter.git;a=commitdiff;h=75a26dbe0f49951ac3a298cbad1cc80360b22335;hp=45fb7c296cabaa916bc9b5d6dc0486a7fe9469b0
Author: Simon Tatham <anakin at pobox.com>
Date: Tue Oct 9 19:00:15 2018 +0100
Move a lot of main.c out into a new mainloop.c.
The parts I've moved are essentially the main select loop, together
with some setup code for signal handling. The idea is that main.c now
gives mainloop.c a list of signals it wants caught via the self-pipe
trick, and a list of pairs of file descriptors to copy data between,
the latter each with a few extra bits and pieces like the translation
state and delay-tracking parameter. Then it just bounces on
mainloop_run(), which does all the reading, writing and buffering of
the copied data itself, and returns signal numbers to its caller to
act on.
The point of this is that I'm about to have a new use for that main
loop logic, so I want to make it convenient to share.
Makefile.am | 22 +--
filter.h | 11 ++
main.c | 450 +++++-------------------------------------------------------
mainloop.c | 412 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
pty.c | 5 +
5 files changed, 477 insertions(+), 423 deletions(-)
commit 2b9a5de6f2cc285c7a535126c625bfd0bf9e035b
web diff https://git.tartarus.org/?p=simon/filter.git;a=commitdiff;h=2b9a5de6f2cc285c7a535126c625bfd0bf9e035b;hp=75a26dbe0f49951ac3a298cbad1cc80360b22335
Author: Simon Tatham <anakin at pobox.com>
Date: Tue Oct 9 19:22:38 2018 +0100
New utility 'linktty', for non-networked gdbserver.
I keep being annoyed that if you want to use gdbserver to debug a
program running on the same host (e.g. because it's buried deep in
some process structure that makes it hard to run directly in gdb, or
because you can't interfere with where its standard I/O is going), the
best you can do is something like
gdbserver localhost:1234 program-to-debug
gdb -ex 'target remote localhost:1234' program
in which gdbserver listens for connections from any host, and when one
comes in, gives it full control over a process running as you without
any authentication or session security.
It would be nice to make gdbserver run over some more secure channel
such as a Unix-domain socket with the right permissions. But the only
other thing it seems to want to talk to is a terminal device, which it
assumes is a serial line connecting to some other physical machine.
So here's a program that sets up two ptys, in raw mode, to behave as
if connected directly to each other - i.e. just as if they were
opposite ends of an 8-bit clean serial link. Now you can point
gdbserver at one, and gdb at the other, and the ptys have sensible
permissions, i.e. only accessible by the user who created them.
The ptys are allocated in the usual way, so they could be called
anything. But the program will symlink them to known paths if you ask
it to. Also, you can make it spawn a child process whose lifetime it
shares, which is a convenient way to make it stop once gdbserver
terminates.
My current cooked rune for using this program is to say something like
linktty /path1 /path2 gdbserver /path2 command-to-debug
gdb -ex 'target remote /path1' executable-file
and then type 'monitor exit' in gdb when finished, which will cause
gdbserver to terminate, and linktty will go with it.
.gitignore | 1 +
Makefile.am | 4 +-
linktty.c | 155 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
mainloop.c | 10 ++--
4 files changed, 165 insertions(+), 5 deletions(-)
More information about the tartarus-commits
mailing list