rdbfs: add -s srvname (from charles forsyth's rdbfs-srvname patch)

Add a -s srvname option to rdbfs, allowing debugging sessions to be shared
or later reattached after disconnection.
This commit is contained in:
cinap_lenrek 2013-06-14 23:28:59 +02:00
parent c198a557d9
commit 0a7e9ba1f5
2 changed files with 19 additions and 2 deletions

View file

@ -11,6 +11,10 @@ rdbfs \- remote kernel debugging file system
.I pid
]
[
.B -s
.I srvname
]
[
.B -t
.I text
]
@ -28,6 +32,15 @@ a kernel over the serial line
.I device
(default
.BR /dev/eia0 ).
If the
.B -s
option is given,
.I rdbfs
will post its channel in
.BI /srv/ srvname
(see
.IR srv (3)),
allowing the session to be shared or reattached later.
.PP
The
.B text

View file

@ -137,12 +137,13 @@ Biobuf rfb;
char* portname = "/dev/eia0";
char* textfile = "/386/9pc";
char* procname = "1";
char* srvname;
Channel* rchan;
void
usage(void)
{
fprint(2, "usage: rdbfs [-p procnum] [-t textfile] [serialport]\n");
fprint(2, "usage: rdbfs [-p procnum] [-s srvname] [-t textfile] [serialport]\n");
exits("usage");
}
@ -397,6 +398,9 @@ threadmain(int argc, char **argv)
case 'p':
procname = EARGF(usage());
break;
case 's':
srvname = EARGF(usage());
break;
case 't':
textfile = EARGF(usage());
break;
@ -427,7 +431,7 @@ threadmain(int argc, char **argv)
for(i=0; i<nelem(tab); i++)
closefile(createfile(dir, tab[i].s, "rdbfs", tab[i].mode, (void*)tab[i].id));
closefile(dir);
threadpostmountsrv(&fs, nil, "/proc", MBEFORE);
threadpostmountsrv(&fs, srvname, "/proc", MBEFORE);
exits(0);
}