History

20080116-1340

Charles.Forsyth committed 18 years ago

Commit f4bb33e1 parent 25a614358 files · +258 −12Browse files

Unified · Split

58 files
  1. CHANGES +3 −0
  2. appl/cmd/archfs.b +1 −1
  3. appl/cmd/auth/changelogin.b +0 −1
  4. appl/cmd/auth/keysrv.b +2 −2
  5. appl/cmd/auth/passwd.b +2 −2
  6. appl/cmd/cpu.b +1 −1
  7. appl/cmd/dbfs.b +1 −1
  8. appl/cmd/env.b +1 −2
  9. appl/cmd/gzip.b +1 −1
  10. appl/cmd/itest.b +4 −4
  11. appl/cmd/itreplay.b +1 −1
  12. appl/cmd/logfile.b +2 −2
  13. appl/cmd/mdb.b +202 −0
  14. appl/cmd/memfs.b +3 −3
  15. appl/cmd/mkdir.b +1 −1
  16. appl/cmd/mntgen.b +1 −1
  17. appl/cmd/mouse.b +2 −2
  18. appl/cmd/mv.b +0 −1
  19. appl/cmd/ramfile.b +2 −2
  20. appl/cmd/rcmd.b +1 −1
  21. appl/cmd/stack.b +2 −2
  22. appl/cmd/stackv.b +2 −0
  23. appl/cmd/styxchat.b +1 −1
  24. appl/cmd/styxlisten.b +1 −1
  25. appl/cmd/tail.b +2 −2
  26. appl/cmd/telnet.b +1 −1
  27. appl/cmd/tsort.b +1 −1
  28. appl/cmd/xmount.b +1 −1
  29. appl/cmd/yacc.b +0 −1
  30. dis/archfs.dis +0 −0
  31. dis/auth/changelogin.dis +0 −0
  32. dis/auth/keysrv.dis +0 −0
  33. dis/auth/passwd.dis +0 −0
  34. dis/cpu.dis +0 −0
  35. dis/dbfs.dis +0 −0
  36. dis/env.dis +0 −0
  37. dis/gzip.dis +0 −0
  38. dis/itest.dis +0 −0
  39. dis/itreplay.dis +0 −0
  40. dis/logfile.dis +0 −0
  41. dis/mdb.dis +0 −0
  42. dis/memfs.dis +0 −0
  43. dis/mkdir.dis +0 −0
  44. dis/mntgen.dis +0 −0
  45. dis/mouse.dis +0 −0
  46. dis/mv.dis +0 −0
  47. dis/ramfile.dis +0 −0
  48. dis/rcmd.dis +0 −0
  49. dis/stack.dis +0 −0
  50. dis/stackv.dis +0 −0
  51. dis/styxchat.dis +0 −0
  52. dis/styxlisten.dis +0 −0
  53. dis/tail.dis +0 −0
  54. dis/telnet.dis +0 −0
  55. dis/tsort.dis +0 −0
  56. dis/xmount.dis +0 −0
  57. dis/yacc.dis +0 −0
  58. man/1/mdb +44 −1
CHANGES+3−0
@@ -1,5 +1,8 @@
11 20080116
22 add rsa to factotum
3+ set but not used changes from Acme-sac
4+ mdb(1) changes from Acme-sac
5+ ftpfs uses new dial(2)
36 20080115
47 add blowfish to keyring (not yet documented)
58 add explicit public and private key types to keyring (in development: not yet documented)
appl/cmd/archfs.b+1−1
@@ -125,7 +125,7 @@ init(nil: ref Draw->Context, args: list of string) · 124 unmodified lines
125125 fatal("can't create pipe");
126126 pidch := chan of int;
127127 spawn serve(p[1], pidch);
128− pid := <- pidch;
128+ <- pidch;
129129 if(sys->mount(p[0], nil, mtpt, flags, nil) < 0)
130130 fatal(sys->sprint("cannot mount archive on %s: %r", mtpt));
131131 }
appl/cmd/auth/changelogin.b+0−1
@@ -206,7 +206,6 @@ getuser(id: string): (string, array of byte, int, string) · 205 unmodified lines
206206 if(sys->read(fd, secret, len secret) != len secret)
207207 return (nil, nil, 0, sys->sprint("error reading %s/secret: %r", id));
208208 }
209− expiry := 0;
210209 fd = sys->open(dbdir+"/expire", Sys->OREAD);
211210 if(fd == nil)
212211 return (nil, nil, 0, sys->sprint("can't open %s/expiry: %r", id));
appl/cmd/auth/keysrv.b+2−2
@@ -116,7 +116,7 @@ worker(file: ref Sys->FileIO, user: string, exitc: chan of int) · 115 unmodified lines
116116 for(;;)alt{
117117 <-exitc =>
118118 exit;
119− (nil, nbytes, fid, rc) := <-file.read =>
119+ (nil, nil, nil, rc) := <-file.read =>
120120 if(rc == nil)
121121 break;
122122 if(err != nil){
@@ -124,7 +124,7 @@ worker(file: ref Sys->FileIO, user: string, exitc: chan of int) · 1 unmodified line
124124 break;
125125 }
126126 rc <-= (nil, nil);
127− (nil, data, fid, wc) := <-file.write =>
127+ (nil, data, nil, wc) := <-file.write =>
128128 if(wc == nil)
129129 break;
130130 if(err != nil){
appl/cmd/auth/passwd.b+2−2
@@ -80,7 +80,7 @@ init(nil: ref Draw->Context, args: list of string) · 79 unmodified lines
8080 sys->print("key owner: %s\n", ai.mypk.owner);
8181
8282 sys->pctl(Sys->FORKNS|Sys->FORKFD, nil);
83− remid := mountsrv(ai);
83+ mountsrv(ai);
8484
8585 # get password
8686 ok: int;
@@ -224,7 +224,7 @@ netmkaddr(addr, net, svc: string): string · 137 unmodified lines
224224 {
225225 if(net == nil)
226226 net = "net";
227− (n, l) := sys->tokenize(addr, "!");
227+ (n, nil) := sys->tokenize(addr, "!");
228228 if(n <= 1){
229229 if(svc== nil)
230230 return sys->sprint("%s!%s", net, addr);
appl/cmd/cpu.b+1−1
@@ -156,7 +156,7 @@ netmkaddr(addr, net, svc: string): string · 155 unmodified lines
156156 {
157157 if(net == nil)
158158 net = "net";
159− (n, l) := sys->tokenize(addr, "!");
159+ (n, nil) := sys->tokenize(addr, "!");
160160 if(n <= 1){
161161 if(svc== nil)
162162 return sys->sprint("%s!%s", net, addr);
appl/cmd/dbfs.b+1−1
@@ -120,7 +120,7 @@ init(nil: ref Draw->Context, args: list of string) · 119 unmodified lines
120120
121121 df := bufio->open(file, Sys->OREAD);
122122 if(df == nil && empty){
123− (rc, d) := sys->stat(file);
123+ (rc, nil) := sys->stat(file);
124124 if(rc < 0)
125125 df = bufio->create(file, Sys->OREAD, 8r600);
126126 }
appl/cmd/env.b+1−2
@@ -32,8 +32,7 @@ init(nil: ref Draw->Context, argv: list of string) · 31 unmodified lines
3232 readdir := load Readdir Readdir->PATH;
3333 if(readdir == nil)
3434 error(sys->sprint("can't load %s: %r", Readdir->PATH));
35− (a, n) := readdir->init("/env",
36− Readdir->NONE | Readdir->COMPACT | Readdir->DESCENDING);
35+ (a, nil) := readdir->init("/env", Readdir->NONE | Readdir->COMPACT | Readdir->DESCENDING);
3736 for(i := 0; i < len a; i++){
3837 s := a[i].name+"="+env->getenv(a[i].name)+"\n";
3938 b := array of byte s;
appl/cmd/gzip.b+1−1
@@ -145,7 +145,7 @@ gzip(nil: string, nil: int, bin, bout: ref Iobuf, fin, fout: string): int · 144 unmodified lines
145145 if (debug)
146146 param += "dv";
147147 rq := deflate->start(param);
148− crc := 0;
148+
149149 for (;;) {
150150 pick m := <-rq {
151151 Fill =>
appl/cmd/itest.b+4−4
@@ -116,7 +116,7 @@ init(ctxt: ref Draw->Context, args: list of string) · 115 unmodified lines
116116 else rs = "s";
117117 mreport(0, S_INFO, 2, sys->sprint("Starting tests - %s run%s of %d test%s", reps, rs, len testlist, ts));
118118 run := big 1;
119− tlist := testlist;
119+
120120 if (recroot != nil)
121121 recn := highest(recroot) + 1;
122122 while (repcount == 0 || run <= big repcount) {
@@ -259,7 +259,7 @@ runtest(t: ref Test) · 136 unmodified lines
259259 {
260260 if (t.failed)
261261 return;
262− path := t.fullspec;
262+
263263 if (cflag != -1) {
264264 mreport(0, S_INFO, 7, sys->sprint("Setting cflag to %d", cflag));
265265 set_cflag(cflag);
@@ -270,7 +270,7 @@ runtest(t: ref Test) · 4 unmodified lines
270270 display_file(readme);
271271 sync := chan of int;
272272 spawn monitor(t, sync);
273− pid := <-sync;
273+ <-sync;
274274 }
275275
276276 monitor(t: ref Test, sync: chan of int)
@@ -299,7 +299,7 @@ monitor(t: ref Test, sync: chan of int) · 22 unmodified lines
299299 etime := -1;
300300 rsync := chan of int;
301301 spawn runit(t.fullspec, t.stdout, t.stderr, t.spec, pa[0], rsync);
302− rpid := <-rsync;
302+ <-rsync;
303303 pa[0] = nil;
304304 (nwarns, nerrors, nfatals) := (0, 0, 0);
305305 while (1) {
appl/cmd/itreplay.b+1−1
@@ -144,7 +144,7 @@ replay_msgs(mfile: string, tspec: string, cflag: int) · 143 unmodified lines
144144 return;
145145 (nwarns, nerrors, nfatals) := (0, 0, 0);
146146 stime := 0;
147− etime := 0;
147+
148148 while ((line := mf.gets('\n')) != nil) {
149149 (whens, rest) := str->splitl(line, ":");
150150 when := int whens;
appl/cmd/logfile.b+2−2
@@ -87,7 +87,7 @@ logserver(fio: ref Sys->FileIO, bufsize: int) · 86 unmodified lines
8787 for (;;) alt {
8888 <-availchan =>
8989 availcount++;
90− (off, count, fid, rc) := <-fio.read =>
90+ (nil, count, fid, rc) := <-fio.read =>
9191 r := readers.get(fid);
9292 if (rc == nil) {
9393 if (r != nil)
@@ -112,7 +112,7 @@ logserver(fio: ref Sys->FileIO, bufsize: int) · 18 unmodified lines
112112 r.rq = (count, rc) :: r.rq;
113113 }
114114
115− (off, data, fid, wc) := <-fio.write =>
115+ (nil, data, nil, wc) := <-fio.write =>
116116 if (wc == nil)
117117 continue;
118118 if ((n := buf.put(data)) < len data)
appl/cmd/mdb.b+202−0
@@ -11,6 +11,16 @@ include "string.m"; · 10 unmodified lines
1111 include "bufio.m";
1212 bufio: Bufio;
1313 Iobuf: import bufio;
14+include "dis.m";
15+ dis: Dis;
16+ Inst, Type, Data, Link, Mod: import dis;
17+ XMAGIC: import Dis;
18+ MUSTCOMPILE, DONTCOMPILE: import Dis;
19+ AMP, AFP, AIMM, AXXX, AIND, AMASK: import Dis;
20+ ARM, AXNON, AXIMM, AXINF, AXINM: import Dis;
21+ DEFB, DEFW, DEFS, DEFF, DEFA, DIND, DAPOP, DEFL: import Dis;
22+disfile: string;
23+m: ref Mod;
1424
1525 Mdb: module
1626 {
@@ -151,9 +161,29 @@ docmd(s: string) · 134 unmodified lines
151161 writemem(2, s[2:]);
152162 'W' =>
153163 writemem(4, s[2:]);
164+ 'i' =>
165+ das();
154166 * =>
155167 dumpmem(s[1:], cmd);
156168 }
169+ '$' =>
170+ case s[1] {
171+ 'D' =>
172+ desc();
173+ 'h' =>
174+ hdr();
175+ 'l' =>
176+ link();
177+ 'i' =>
178+ imports();
179+ 'd' =>
180+ dat();
181+ 'H' =>
182+ handlers();
183+ 's' =>
184+ if(m != nil)
185+ print("%s\n", m.srcpath);
186+ }
157187 '=' =>
158188 dumpmem(s[1:], cmd);
159189 * =>
@@ -294,6 +324,8 @@ init(nil: ref Draw->Context, argv: list of string) · 134 unmodified lines
294324 sys->fprint(stderr, "mdb: cannot load %s: %r\n", Bufio->PATH);
295325 raise "fail:bad module";
296326 }
327+ dis = load Dis Dis->PATH;
328+ dis->init();
297329
298330 if (len argv < 2)
299331 usage();
@@ -321,6 +353,7 @@ init(nil: ref Draw->Context, argv: list of string) · 21 unmodified lines
321353 sys->fprint(stderr, "mdb: cannot open %s: %r\n", fname);
322354 raise "fail:cannot open";
323355 }
356+ (m, nil) = dis->loadobj(fname);
324357
325358 if(cmd != nil)
326359 docmd(cmd);
@@ -333,3 +366,172 @@ init(nil: ref Draw->Context, argv: list of string) · 6 unmodified lines
333366 }
334367 }
335368 }
369+
370+link()
371+{
372+ if(m == nil || m.magic == 0)
373+ return;
374+
375+ for(i := 0; i < m.lsize; i++) {
376+ l := m.links[i];
377+ print(" link %d,%d, 0x%ux, \"%s\"\n",
378+ l.desc, l.pc, l.sig, l.name);
379+ }
380+}
381+
382+imports()
383+{
384+ if(m == nil || m.magic == 0)
385+ return;
386+
387+ mi := m.imports;
388+ for(i := 0; i < len mi; i++) {
389+ a := mi[i];
390+ for(j := 0; j < len a; j++) {
391+ ai := a[j];
392+ print(" import 0x%ux, \"%s\"\n", ai.sig, ai.name);
393+ }
394+ }
395+}
396+
397+handlers()
398+{
399+ if(m == nil || m.magic == 0)
400+ return;
401+
402+ hs := m.handlers;
403+ for(i := 0; i < len hs; i++) {
404+ h := hs[i];
405+ tt := -1;
406+ for(j := 0; j < len m.types; j++) {
407+ if(h.t == m.types[j]) {
408+ tt = j;
409+ break;
410+ }
411+ }
412+ print(" %d-%d, o=%d, e=%d t=%d\n", h.pc1, h.pc2, h.eoff, h.ne, tt);
413+ et := h.etab;
414+ for(j = 0; j < len et; j++) {
415+ e := et[j];
416+ if(e.s == nil)
417+ print(" %d *\n", e.pc);
418+ else
419+ print(" %d \"%s\"\n", e.pc, e.s);
420+ }
421+ }
422+}
423+
424+desc()
425+{
426+ if(m == nil || m.magic == 0)
427+ return;
428+
429+ for(i := 0; i < m.tsize; i++) {
430+ h := m.types[i];
431+ s := sprint(" desc $%d, %d, \"", i, h.size);
432+ for(j := 0; j < h.np; j++)
433+ s += sprint("%.2ux", int h.map[j]);
434+ s += "\"\n";
435+ print("%s", s);
436+ }
437+}
438+
439+hdr()
440+{
441+ if(m == nil || m.magic == 0)
442+ return;
443+ s := sprint("%.8ux Version %d Dis VM\n", m.magic, m.magic - XMAGIC + 1);
444+ s += sprint("%.8ux Runtime flags %s\n", m.rt, rtflag(m.rt));
445+ s += sprint("%8d bytes per stack extent\n\n", m.ssize);
446+
447+
448+ s += sprint("%8d instructions\n", m.isize);
449+ s += sprint("%8d data size\n", m.dsize);
450+ s += sprint("%8d heap type descriptors\n", m.tsize);
451+ s += sprint("%8d link directives\n", m.lsize);
452+ s += sprint("%8d entry pc\n", m.entry);
453+ s += sprint("%8d entry type descriptor\n\n", m.entryt);
454+
455+ if(m.sign == nil)
456+ s += "Module is Insecure\n";
457+ print("%s", s);
458+}
459+
460+rtflag(flag: int): string
461+{
462+ if(flag == 0)
463+ return "";
464+
465+ s := "[";
466+
467+ if(flag & MUSTCOMPILE)
468+ s += "MustCompile";
469+ if(flag & DONTCOMPILE) {
470+ if(flag & MUSTCOMPILE)
471+ s += "|";
472+ s += "DontCompile";
473+ }
474+ s[len s] = ']';
475+
476+ return s;
477+}
478+
479+das()
480+{
481+ if(m == nil || m.magic == 0)
482+ return;
483+
484+ for(i := dot; count-- > 0 && i < m.isize; i++) {
485+ if(i % 10 == 0)
486+ print("#%d\n", i);
487+ print("\t%s\n", dis->inst2s(m.inst[i]));
488+ }
489+}
490+
491+dat()
492+{
493+ if(m == nil || m.magic == 0)
494+ return;
495+ print(" var @mp, %d\n", m.types[0].size);
496+
497+ s := "";
498+ for(d := m.data; d != nil; d = tl d) {
499+ pick dat := hd d {
500+ Bytes =>
501+ s = sprint("\tbyte @mp+%d", dat.off);
502+ for(n := 0; n < dat.n; n++)
503+ s += sprint(",%d", int dat.bytes[n]);
504+ Words =>
505+ s = sprint("\tword @mp+%d", dat.off);
506+ for(n := 0; n < dat.n; n++)
507+ s += sprint(",%d", dat.words[n]);
508+ String =>
509+ s = sprint("\tstring @mp+%d, \"%s\"", dat.off, mapstr(dat.str));
510+ Reals =>
511+ s = sprint("\treal @mp+%d", dat.off);
512+ for(n := 0; n < dat.n; n++)
513+ s += sprint(", %g", dat.reals[n]);
514+ break;
515+ Array =>
516+ s = sprint("\tarray @mp+%d,$%d,%d", dat.off, dat.typex, dat.length);
517+ Aindex =>
518+ s = sprint("\tindir @mp+%d,%d", dat.off, dat.index);
519+ Arestore =>
520+ s = "\tapop";
521+ break;
522+ Bigs =>
523+ s = sprint("\tlong @mp+%d", dat.off);
524+ for(n := 0; n < dat.n; n++)
525+ s += sprint(", %bd", dat.bigs[n]);
526+ }
527+ print("%s\n", s);
528+ }
529+}
530+
531+mapstr(s: string): string
532+{
533+ for(i := 0; i < len s; i++)
534+ if(s[i] == '\n')
535+ s = s[0:i] + "\\n" + s[i+1:];
536+ return s;
537+}
appl/cmd/memfs.b+3−3
@@ -217,7 +217,7 @@ memfs(maxsz : int, tc : chan of ref Tmsg, srv : ref Styxserver, sync: chan of in · 216 unmodified lines
217217 c.mode = tm.mode;
218218 c.qid.vers = mf.qid.vers;
219219 mf.nopen++;
220− if (tm.mode & OTRUNC) {
220+ if ((tm.mode & OTRUNC) && !(mf.perm & Sys->DMAPPEND)) {
221221 # OTRUNC cannot be set for a directory
222222 # always at least one blk so don't need to check fs limit
223223 freeblks += (len mf.data);
@@ -321,7 +321,7 @@ memfs(maxsz : int, tc : chan of ref Tmsg, srv : ref Styxserver, sync: chan of in · 97 unmodified lines
321321 }
322322 srv.reply(ref Rmsg.Clunk(tm.tag));
323323 Stat =>
324− (err, c, mf) := fidtomf(srv, qhash, tm.fid);
324+ (err, nil, mf) := fidtomf(srv, qhash, tm.fid);
325325 if (err != nil) {
326326 srv.reply(ref Rmsg.Error(tm.tag, err));
327327 continue;
@@ -354,7 +354,7 @@ memfs(maxsz : int, tc : chan of ref Tmsg, srv : ref Styxserver, sync: chan of in · 26 unmodified lines
354354 Wstat =>
355355 (err, c, mf) := fidtomf(srv, qhash, tm.fid);
356356 stat := tm.stat;
357− perm := mf.perm & ~Sys->DMDIR;
357+
358358 if (err == nil && stat.name != mf.name) {
359359 parent := mf.parent;
360360 if (!modeok(OWRITE, parent.perm, c.uname, parent.owner))
appl/cmd/mkdir.b+1−1
@@ -29,7 +29,7 @@ init(nil: ref Draw->Context, argv: list of string) · 28 unmodified lines
2929 for(; argv != nil; argv = tl argv){
3030 dir := hd argv;
3131 if(!pflag){
32− (ok, d) := sys->stat(dir);
32+ (ok, nil) := sys->stat(dir);
3333 if(ok < 0){
3434 if(mkdir(dir) < 0)
3535 e = "error";
appl/cmd/mntgen.b+1−1
@@ -79,7 +79,7 @@ walk1(c: ref Fid, name: string): string · 78 unmodified lines
7979 decref(c.path);
8080 c.walk(Sys->Qid(Qroot, 0, Sys->QTDIR));
8181 } else if (c.path == Qroot) {
82− (d, err) := nav.walk(c.path, name);
82+ (d, nil) := nav.walk(c.path, name);
8383 if (d == nil)
8484 d = addentry(name);
8585 else
appl/cmd/mouse.b+2−2
@@ -49,8 +49,8 @@ init(nil: ref Draw->Context, argv: list of string) · 48 unmodified lines
4949 usage();
5050
5151 argv = tl argv;
52− def := 0;
53− baud := 0;
52+
53+
5454 while (argv != nil && len (arg := hd argv) > 1 && arg[0] == '-') {
5555 case arg[1] {
5656 'D' =>
appl/cmd/mv.b+0−1
@@ -113,7 +113,6 @@ mv(from,todir,toelem : string): int · 112 unmodified lines
113113 sys->fprint(stderr, "mv: can't open %s: %r\n", fromname);
114114 return -1;
115115 }
116− (j,dirt):=sys->stat(toname);
117116 fdt := sys->create(toname, Sys->OWRITE, dirb.mode);
118117 if(fdt == nil){
119118 sys->fprint(stderr, "mv: can't create %s: %r\n", toname);
appl/cmd/ramfile.b+2−2
@@ -52,7 +52,7 @@ init(nil: ref Draw->Context, argv: list of string) · 51 unmodified lines
5252 server(fio: ref Sys->FileIO, data: array of byte)
5353 {
5454 for (;;) alt {
55− (offset, count, fid, rc) := <-fio.read =>
55+ (offset, count, nil, rc) := <-fio.read =>
5656 if (rc != nil) {
5757 if (offset > len data)
5858 rc <-= (nil, nil);
@@ -63,7 +63,7 @@ server(fio: ref Sys->FileIO, data: array of byte) · 4 unmodified lines
6363 rc <-= (data[offset:end], nil);
6464 }
6565 }
66− (offset, d, fid, wc) := <-fio.write =>
66+ (offset, d, nil, wc) := <-fio.write =>
6767 if (wc != nil) {
6868 if (offset == 0)
6969 data = array[0] of byte;
appl/cmd/rcmd.b+1−1
@@ -141,7 +141,7 @@ netmkaddr(addr, net, svc: string): string · 140 unmodified lines
141141 {
142142 if(net == nil)
143143 net = "net";
144− (n, l) := sys->tokenize(addr, "!");
144+ (n, nil) := sys->tokenize(addr, "!");
145145 if(n <= 1){
146146 if(svc== nil)
147147 return sys->sprint("%s!%s", net, addr);
appl/cmd/stack.b+2−2
@@ -155,7 +155,7 @@ stdsym(m: ref Module) · 154 unmodified lines
155155 }
156156 if(dism != nil && (sp := dism->src(dis)) != nil){
157157 sp = sp[0: len sp - 1] + "sbl";
158− (sym, err) := debug->sym(sp);
158+ (sym, nil) := debug->sym(sp);
159159 if (sym != nil) {
160160 m.addsym(sym);
161161 return;
@@ -167,7 +167,7 @@ stdsym(m: ref Module) · 5 unmodified lines
167167 sblpath = sblpath + dis[len dispath:];
168168 if (len sblpath > 4 && sblpath[len sblpath - 4:] == ".dis")
169169 sblpath = sblpath[0:len sblpath - 4] + ".sbl";
170− (sym, err) := debug->sym(sblpath);
170+ (sym, nil) := debug->sym(sblpath);
171171 if (sym != nil) {
172172 m.addsym(sym);
173173 return;
appl/cmd/stackv.b+2−0
@@ -360,6 +360,8 @@ plist(exp: ref Exp, v: string, w: int, depth: int) · 359 unmodified lines
360360 while(w && v != "nil"){
361361 exps := exp.expand();
362362 h := getname(exps, "hd");
363+ if(h == nil)
364+ break;
363365 (hv, vw) := h.val();
364366 if(pref(v) == 0)
365367 return;
appl/cmd/styxchat.b+1−1
@@ -111,7 +111,7 @@ netmkaddr(addr, net, svc: string): string · 110 unmodified lines
111111 {
112112 if(net == nil)
113113 net = "net";
114− (n, l) := sys->tokenize(addr, "!");
114+ (n, nil) := sys->tokenize(addr, "!");
115115 if(n <= 1){
116116 if(svc== nil)
117117 return sys->sprint("%s!%s", net, addr);
appl/cmd/styxlisten.b+1−1
@@ -250,7 +250,7 @@ netmkaddr(addr, net, svc: string): string · 249 unmodified lines
250250 {
251251 if(net == nil)
252252 net = "net";
253− (n, l) := sys->tokenize(addr, "!");
253+ (n, nil) := sys->tokenize(addr, "!");
254254 if(n <= 1){
255255 if(svc== nil)
256256 return sys->sprint("%s!%s", net, addr);
appl/cmd/tail.b+2−2
@@ -57,7 +57,7 @@ init(nil: ref Draw->Context, argv: list of string) · 56 unmodified lines
5757 else {
5858 if((file=sys->open(hd argv,sys->OREAD)) == nil )
5959 fatal(hd argv);
60− (ok, stat) := sys->fstat(file);
60+ (nil, stat) := sys->fstat(file);
6161 seekable = sys->seek(file,big 0,sys->SEEKSTART) == big 0 && stat.length > big 0;
6262 }
6363
@@ -99,7 +99,7 @@ init(nil: ref Draw->Context, argv: list of string) · 35 unmodified lines
9999
100100 trunc(length : big) : sys->Dir
101101 {
102− (i,d):=sys->fstat(file);
102+ (nil,d):=sys->fstat(file);
103103 if(d.length < length)
104104 d.length = tseek(big 0, sys->SEEKSTART);
105105 return d;
appl/cmd/telnet.b+1−1
@@ -470,7 +470,7 @@ netmkaddr(addr, net, svc: string): string · 469 unmodified lines
470470 {
471471 if(net == nil)
472472 net = "net";
473− (n, l) := sys->tokenize(addr, "!");
473+ (n, nil) := sys->tokenize(addr, "!");
474474 if(n <= 1){
475475 if(svc== nil)
476476 return sys->sprint("%s!%s", net, addr);
appl/cmd/tsort.b+1−1
@@ -60,7 +60,7 @@ input() · 59 unmodified lines
6060 {
6161 b := bufio->fopen(sys->fildes(0), Sys->OREAD);
6262 while((line := b.gets('\n')) != nil){
63− (nf, fld) := sys->tokenize(line, " \t\n");
63+ (nil, fld) := sys->tokenize(line, " \t\n");
6464 if(fld != nil){
6565 a := finditem(hd fld);
6666 while((fld = tl fld) != nil)
appl/cmd/xmount.b+1−1
@@ -219,7 +219,7 @@ netmkaddr(addr, net, svc: string): string · 218 unmodified lines
219219 {
220220 if(net == nil)
221221 net = "net";
222− (n, l) := sys->tokenize(addr, "!");
222+ (n, nil) := sys->tokenize(addr, "!");
223223 if(n <= 1){
224224 if(svc== nil)
225225 return sys->sprint("%s!%s", net, addr);
appl/cmd/yacc.b+0−1
@@ -781,7 +781,6 @@ gettok(): int · 780 unmodified lines
781781
782782 tokname = "";
783783 for(;;){
784− reserve := 0;
785784 lineno += peekline;
786785 peekline = 0;
787786 c = finput.getc();
dis/archfs.dis+0−0

Binary file not shown.

dis/auth/changelogin.dis+0−0

Binary file not shown.

dis/auth/keysrv.dis+0−0

Binary file not shown.

dis/auth/passwd.dis+0−0

Binary file not shown.

dis/cpu.dis+0−0

Binary file not shown.

dis/dbfs.dis+0−0

Binary file not shown.

dis/env.dis+0−0

Binary file not shown.

dis/gzip.dis+0−0

Binary file not shown.

dis/itest.dis+0−0

Binary file not shown.

dis/itreplay.dis+0−0

Binary file not shown.

dis/logfile.dis+0−0

Binary file not shown.

dis/mdb.dis+0−0

Binary file not shown.

dis/memfs.dis+0−0

Binary file not shown.

dis/mkdir.dis+0−0

Binary file not shown.

dis/mntgen.dis+0−0

Binary file not shown.

dis/mouse.dis+0−0

Binary file not shown.

dis/mv.dis+0−0

Binary file not shown.

dis/ramfile.dis+0−0

Binary file not shown.

dis/rcmd.dis+0−0

Binary file not shown.

dis/stack.dis+0−0

Binary file not shown.

dis/stackv.dis+0−0

Binary file not shown.

dis/styxchat.dis+0−0

Binary file not shown.

dis/styxlisten.dis+0−0

Binary file not shown.

dis/tail.dis+0−0

Binary file not shown.

dis/telnet.dis+0−0

Binary file not shown.

dis/tsort.dis+0−0

Binary file not shown.

dis/xmount.dis+0−0

Binary file not shown.

dis/yacc.dis+0−0

Binary file not shown.

man/1/mdb+44−1
@@ -181,7 +181,7 @@ Prints a single byte as a printable character, converting · 180 unmodified lines
181181 it to backslash escaped hex if necessary.
182182 .RE
183183 .PD
184−There are two other commands:
184+Other commands include:
185185 .TP 10
186186 .RB [ ?/ ] w\ \fIvalue\fP
187187 Write the two-byte
@@ -192,8 +192,51 @@ to the addressed location. · 4 unmodified lines
192192 Write the four-byte
193193 .I value
194194 to the addressed location.
195+.TP
196+.RB [ ?/ ] i
197+Disassemble
198+.I count
199+instructions starting at
200+.I address
201+.RI ( dot
202+by default).
203+.TP
204+.BI $ modifier
205+.I File
206+must be a
207+.IR dis (6)
208+file.
209+.I Modifier
210+is one of the following subcommands:
211+.RS
212+.TP
213+.PD 0
214+.B D
215+Print the descriptor section.
216+.TP
217+.B h
218+Print the file header.
219+.TP
220+.B l
221+Print the links section.
222+.TP
223+.B i
224+Print the import section.
225+.TP
226+.B d
227+Print the data section.
228+.TP
229+.B H
230+Print exception handler tables.
231+.TP
232+.B s
233+Print the name of the source file.
234+.PD
235+.RE
195236 .SH SOURCE
196237 .B /appl/cmd/mdb.b
238+.SH SEE ALSO
239+.IR dis (6)
197240 .SH BUGS
198241 Most of the more useful features of
199242 .IR mdb 's