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:
parent
c198a557d9
commit
0a7e9ba1f5
2 changed files with 19 additions and 2 deletions
|
@ -11,6 +11,10 @@ rdbfs \- remote kernel debugging file system
|
||||||
.I pid
|
.I pid
|
||||||
]
|
]
|
||||||
[
|
[
|
||||||
|
.B -s
|
||||||
|
.I srvname
|
||||||
|
]
|
||||||
|
[
|
||||||
.B -t
|
.B -t
|
||||||
.I text
|
.I text
|
||||||
]
|
]
|
||||||
|
@ -28,6 +32,15 @@ a kernel over the serial line
|
||||||
.I device
|
.I device
|
||||||
(default
|
(default
|
||||||
.BR /dev/eia0 ).
|
.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
|
.PP
|
||||||
The
|
The
|
||||||
.B text
|
.B text
|
||||||
|
|
|
@ -137,12 +137,13 @@ Biobuf rfb;
|
||||||
char* portname = "/dev/eia0";
|
char* portname = "/dev/eia0";
|
||||||
char* textfile = "/386/9pc";
|
char* textfile = "/386/9pc";
|
||||||
char* procname = "1";
|
char* procname = "1";
|
||||||
|
char* srvname;
|
||||||
Channel* rchan;
|
Channel* rchan;
|
||||||
|
|
||||||
void
|
void
|
||||||
usage(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");
|
exits("usage");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -397,6 +398,9 @@ threadmain(int argc, char **argv)
|
||||||
case 'p':
|
case 'p':
|
||||||
procname = EARGF(usage());
|
procname = EARGF(usage());
|
||||||
break;
|
break;
|
||||||
|
case 's':
|
||||||
|
srvname = EARGF(usage());
|
||||||
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
textfile = EARGF(usage());
|
textfile = EARGF(usage());
|
||||||
break;
|
break;
|
||||||
|
@ -427,7 +431,7 @@ threadmain(int argc, char **argv)
|
||||||
for(i=0; i<nelem(tab); i++)
|
for(i=0; i<nelem(tab); i++)
|
||||||
closefile(createfile(dir, tab[i].s, "rdbfs", tab[i].mode, (void*)tab[i].id));
|
closefile(createfile(dir, tab[i].s, "rdbfs", tab[i].mode, (void*)tab[i].id));
|
||||||
closefile(dir);
|
closefile(dir);
|
||||||
threadpostmountsrv(&fs, nil, "/proc", MBEFORE);
|
threadpostmountsrv(&fs, srvname, "/proc", MBEFORE);
|
||||||
exits(0);
|
exits(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue