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 @@
120080116120080116
2 add rsa to factotum2 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)
320080115620080115
4 add blowfish to keyring (not yet documented)7 add blowfish to keyring (not yet documented)
5 add explicit public and private key types to keyring (in development: not yet documented)8 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
125 fatal("can't create pipe");125 fatal("can't create pipe");
126 pidch := chan of int;126 pidch := chan of int;
127 spawn serve(p[1], pidch);127 spawn serve(p[1], pidch);
128 pid := <- pidch;128 <- pidch;
129 if(sys->mount(p[0], nil, mtpt, flags, nil) < 0)129 if(sys->mount(p[0], nil, mtpt, flags, nil) < 0)
130 fatal(sys->sprint("cannot mount archive on %s: %r", mtpt));130 fatal(sys->sprint("cannot mount archive on %s: %r", mtpt));
131}131}
appl/cmd/auth/changelogin.b+0−1
@@ -206,7 +206,6 @@ getuser(id: string): (string, array of byte, int, string) · 205 unmodified lines
206 if(sys->read(fd, secret, len secret) != len secret)206 if(sys->read(fd, secret, len secret) != len secret)
207 return (nil, nil, 0, sys->sprint("error reading %s/secret: %r", id));207 return (nil, nil, 0, sys->sprint("error reading %s/secret: %r", id));
208 }208 }
209 expiry := 0;
210 fd = sys->open(dbdir+"/expire", Sys->OREAD);209 fd = sys->open(dbdir+"/expire", Sys->OREAD);
211 if(fd == nil)210 if(fd == nil)
212 return (nil, nil, 0, sys->sprint("can't open %s/expiry: %r", id));211 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
116 for(;;)alt{116 for(;;)alt{
117 <-exitc =>117 <-exitc =>
118 exit;118 exit;
119 (nil, nbytes, fid, rc) := <-file.read =>119 (nil, nil, nil, rc) := <-file.read =>
120 if(rc == nil)120 if(rc == nil)
121 break;121 break;
122 if(err != nil){122 if(err != nil){
@@ -124,7 +124,7 @@ worker(file: ref Sys->FileIO, user: string, exitc: chan of int) · 1 unmodified line
124 break;124 break;
125 }125 }
126 rc <-= (nil, nil);126 rc <-= (nil, nil);
127 (nil, data, fid, wc) := <-file.write =>127 (nil, data, nil, wc) := <-file.write =>
128 if(wc == nil)128 if(wc == nil)
129 break;129 break;
130 if(err != nil){130 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
80sys->print("key owner: %s\n", ai.mypk.owner);80sys->print("key owner: %s\n", ai.mypk.owner);
81 81
82 sys->pctl(Sys->FORKNS|Sys->FORKFD, nil);82 sys->pctl(Sys->FORKNS|Sys->FORKFD, nil);
83 remid := mountsrv(ai);83 mountsrv(ai);
84 84
85 # get password85 # get password
86 ok: int;86 ok: int;
@@ -224,7 +224,7 @@ netmkaddr(addr, net, svc: string): string · 137 unmodified lines
224{224{
225 if(net == nil)225 if(net == nil)
226 net = "net";226 net = "net";
227 (n, l) := sys->tokenize(addr, "!");227 (n, nil) := sys->tokenize(addr, "!");
228 if(n <= 1){228 if(n <= 1){
229 if(svc== nil)229 if(svc== nil)
230 return sys->sprint("%s!%s", net, addr);230 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
156{156{
157 if(net == nil)157 if(net == nil)
158 net = "net";158 net = "net";
159 (n, l) := sys->tokenize(addr, "!");159 (n, nil) := sys->tokenize(addr, "!");
160 if(n <= 1){160 if(n <= 1){
161 if(svc== nil)161 if(svc== nil)
162 return sys->sprint("%s!%s", net, addr);162 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
120 120
121 df := bufio->open(file, Sys->OREAD);121 df := bufio->open(file, Sys->OREAD);
122 if(df == nil && empty){122 if(df == nil && empty){
123 (rc, d) := sys->stat(file);123 (rc, nil) := sys->stat(file);
124 if(rc < 0)124 if(rc < 0)
125 df = bufio->create(file, Sys->OREAD, 8r600);125 df = bufio->create(file, Sys->OREAD, 8r600);
126 }126 }
appl/cmd/env.b+1−2
@@ -32,8 +32,7 @@ init(nil: ref Draw->Context, argv: list of string) · 31 unmodified lines
32 readdir := load Readdir Readdir->PATH;32 readdir := load Readdir Readdir->PATH;
33 if(readdir == nil)33 if(readdir == nil)
34 error(sys->sprint("can't load %s: %r", Readdir->PATH));34 error(sys->sprint("can't load %s: %r", Readdir->PATH));
35 (a, n) := readdir->init("/env",35 (a, nil) := readdir->init("/env", Readdir->NONE | Readdir->COMPACT | Readdir->DESCENDING);
36 Readdir->NONE | Readdir->COMPACT | Readdir->DESCENDING);
37 for(i := 0; i < len a; i++){36 for(i := 0; i < len a; i++){
38 s := a[i].name+"="+env->getenv(a[i].name)+"\n";37 s := a[i].name+"="+env->getenv(a[i].name)+"\n";
39 b := array of byte s;38 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
145 if (debug)145 if (debug)
146 param += "dv";146 param += "dv";
147 rq := deflate->start(param);147 rq := deflate->start(param);
148 crc := 0;148
149 for (;;) {149 for (;;) {
150 pick m := <-rq {150 pick m := <-rq {
151 Fill =>151 Fill =>
appl/cmd/itest.b+4−4
@@ -116,7 +116,7 @@ init(ctxt: ref Draw->Context, args: list of string) · 115 unmodified lines
116 else rs = "s";116 else rs = "s";
117 mreport(0, S_INFO, 2, sys->sprint("Starting tests - %s run%s of %d test%s", reps, rs, len testlist, ts));117 mreport(0, S_INFO, 2, sys->sprint("Starting tests - %s run%s of %d test%s", reps, rs, len testlist, ts));
118 run := big 1;118 run := big 1;
119 tlist := testlist;119
120 if (recroot != nil) 120 if (recroot != nil)
121 recn := highest(recroot) + 1;121 recn := highest(recroot) + 1;
122 while (repcount == 0 || run <= big repcount) {122 while (repcount == 0 || run <= big repcount) {
@@ -259,7 +259,7 @@ runtest(t: ref Test) · 136 unmodified lines
259{259{
260 if (t.failed)260 if (t.failed)
261 return;261 return;
262 path := t.fullspec;262
263 if (cflag != -1) {263 if (cflag != -1) {
264 mreport(0, S_INFO, 7, sys->sprint("Setting cflag to %d", cflag));264 mreport(0, S_INFO, 7, sys->sprint("Setting cflag to %d", cflag));
265 set_cflag(cflag);265 set_cflag(cflag);
@@ -270,7 +270,7 @@ runtest(t: ref Test) · 4 unmodified lines
270 display_file(readme);270 display_file(readme);
271 sync := chan of int;271 sync := chan of int;
272 spawn monitor(t, sync);272 spawn monitor(t, sync);
273 pid := <-sync;273 <-sync;
274}274}
275 275
276monitor(t: ref Test, sync: chan of int)276monitor(t: ref Test, sync: chan of int)
@@ -299,7 +299,7 @@ monitor(t: ref Test, sync: chan of int) · 22 unmodified lines
299 etime := -1;299 etime := -1;
300 rsync := chan of int;300 rsync := chan of int;
301 spawn runit(t.fullspec, t.stdout, t.stderr, t.spec, pa[0], rsync);301 spawn runit(t.fullspec, t.stdout, t.stderr, t.spec, pa[0], rsync);
302 rpid := <-rsync;302 <-rsync;
303 pa[0] = nil;303 pa[0] = nil;
304 (nwarns, nerrors, nfatals) := (0, 0, 0);304 (nwarns, nerrors, nfatals) := (0, 0, 0);
305 while (1) {305 while (1) {
appl/cmd/itreplay.b+1−1
@@ -144,7 +144,7 @@ replay_msgs(mfile: string, tspec: string, cflag: int) · 143 unmodified lines
144 return;144 return;
145 (nwarns, nerrors, nfatals) := (0, 0, 0);145 (nwarns, nerrors, nfatals) := (0, 0, 0);
146 stime := 0;146 stime := 0;
147 etime := 0;147
148 while ((line := mf.gets('\n')) != nil) {148 while ((line := mf.gets('\n')) != nil) {
149 (whens, rest) := str->splitl(line, ":");149 (whens, rest) := str->splitl(line, ":");
150 when := int whens;150 when := int whens;
appl/cmd/logfile.b+2−2
@@ -87,7 +87,7 @@ logserver(fio: ref Sys->FileIO, bufsize: int) · 86 unmodified lines
87 for (;;) alt {87 for (;;) alt {
88 <-availchan =>88 <-availchan =>
89 availcount++;89 availcount++;
90 (off, count, fid, rc) := <-fio.read =>90 (nil, count, fid, rc) := <-fio.read =>
91 r := readers.get(fid);91 r := readers.get(fid);
92 if (rc == nil) {92 if (rc == nil) {
93 if (r != nil)93 if (r != nil)
@@ -112,7 +112,7 @@ logserver(fio: ref Sys->FileIO, bufsize: int) · 18 unmodified lines
112 r.rq = (count, rc) :: r.rq;112 r.rq = (count, rc) :: r.rq;
113 }113 }
114 114
115 (off, data, fid, wc) := <-fio.write =>115 (nil, data, nil, wc) := <-fio.write =>
116 if (wc == nil)116 if (wc == nil)
117 continue;117 continue;
118 if ((n := buf.put(data)) < len data)118 if ((n := buf.put(data)) < len data)
appl/cmd/mdb.b+202−0
@@ -11,6 +11,16 @@ include "string.m"; · 10 unmodified lines
11include "bufio.m";11include "bufio.m";
12 bufio: Bufio;12 bufio: Bufio;
13 Iobuf: import bufio;13 Iobuf: import bufio;
14include "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;
22disfile: string;
23m: ref Mod;
14 24
15Mdb: module25Mdb: module
16{26{
@@ -151,9 +161,29 @@ docmd(s: string) · 134 unmodified lines
151 writemem(2, s[2:]);161 writemem(2, s[2:]);
152 'W' =>162 'W' =>
153 writemem(4, s[2:]);163 writemem(4, s[2:]);
164 'i' =>
165 das();
154 * =>166 * =>
155 dumpmem(s[1:], cmd);167 dumpmem(s[1:], cmd);
156 }168 }
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 }
157 '=' =>187 '=' =>
158 dumpmem(s[1:], cmd);188 dumpmem(s[1:], cmd);
159 * =>189 * =>
@@ -294,6 +324,8 @@ init(nil: ref Draw->Context, argv: list of string) · 134 unmodified lines
294 sys->fprint(stderr, "mdb: cannot load %s: %r\n", Bufio->PATH);324 sys->fprint(stderr, "mdb: cannot load %s: %r\n", Bufio->PATH);
295 raise "fail:bad module";325 raise "fail:bad module";
296 }326 }
327 dis = load Dis Dis->PATH;
328 dis->init();
297 329
298 if (len argv < 2)330 if (len argv < 2)
299 usage();331 usage();
@@ -321,6 +353,7 @@ init(nil: ref Draw->Context, argv: list of string) · 21 unmodified lines
321 sys->fprint(stderr, "mdb: cannot open %s: %r\n", fname);353 sys->fprint(stderr, "mdb: cannot open %s: %r\n", fname);
322 raise "fail:cannot open";354 raise "fail:cannot open";
323 }355 }
356 (m, nil) = dis->loadobj(fname);
324 357
325 if(cmd != nil)358 if(cmd != nil)
326 docmd(cmd);359 docmd(cmd);
@@ -333,3 +366,172 @@ init(nil: ref Draw->Context, argv: list of string) · 6 unmodified lines
333 }366 }
334 }367 }
335}368}
369
370link()
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
382imports()
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
397handlers()
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
424desc()
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
439hdr()
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
460rtflag(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
479das()
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
491dat()
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
531mapstr(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
217 c.mode = tm.mode;217 c.mode = tm.mode;
218 c.qid.vers = mf.qid.vers;218 c.qid.vers = mf.qid.vers;
219 mf.nopen++;219 mf.nopen++;
220 if (tm.mode & OTRUNC) {220 if ((tm.mode & OTRUNC) && !(mf.perm & Sys->DMAPPEND)) {
221 # OTRUNC cannot be set for a directory221 # OTRUNC cannot be set for a directory
222 # always at least one blk so don't need to check fs limit222 # always at least one blk so don't need to check fs limit
223 freeblks += (len mf.data);223 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
321 }321 }
322 srv.reply(ref Rmsg.Clunk(tm.tag));322 srv.reply(ref Rmsg.Clunk(tm.tag));
323 Stat =>323 Stat =>
324 (err, c, mf) := fidtomf(srv, qhash, tm.fid);324 (err, nil, mf) := fidtomf(srv, qhash, tm.fid);
325 if (err != nil) {325 if (err != nil) {
326 srv.reply(ref Rmsg.Error(tm.tag, err));326 srv.reply(ref Rmsg.Error(tm.tag, err));
327 continue;327 continue;
@@ -354,7 +354,7 @@ memfs(maxsz : int, tc : chan of ref Tmsg, srv : ref Styxserver, sync: chan of in · 26 unmodified lines
354 Wstat =>354 Wstat =>
355 (err, c, mf) := fidtomf(srv, qhash, tm.fid);355 (err, c, mf) := fidtomf(srv, qhash, tm.fid);
356 stat := tm.stat;356 stat := tm.stat;
357 perm := mf.perm & ~Sys->DMDIR;357
358 if (err == nil && stat.name != mf.name) {358 if (err == nil && stat.name != mf.name) {
359 parent := mf.parent;359 parent := mf.parent;
360 if (!modeok(OWRITE, parent.perm, c.uname, parent.owner))360 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
29 for(; argv != nil; argv = tl argv){29 for(; argv != nil; argv = tl argv){
30 dir := hd argv;30 dir := hd argv;
31 if(!pflag){31 if(!pflag){
32 (ok, d) := sys->stat(dir);32 (ok, nil) := sys->stat(dir);
33 if(ok < 0){33 if(ok < 0){
34 if(mkdir(dir) < 0)34 if(mkdir(dir) < 0)
35 e = "error";35 e = "error";
appl/cmd/mntgen.b+1−1
@@ -79,7 +79,7 @@ walk1(c: ref Fid, name: string): string · 78 unmodified lines
79 decref(c.path);79 decref(c.path);
80 c.walk(Sys->Qid(Qroot, 0, Sys->QTDIR));80 c.walk(Sys->Qid(Qroot, 0, Sys->QTDIR));
81 } else if (c.path == Qroot) {81 } else if (c.path == Qroot) {
82 (d, err) := nav.walk(c.path, name);82 (d, nil) := nav.walk(c.path, name);
83 if (d == nil)83 if (d == nil)
84 d = addentry(name);84 d = addentry(name);
85 else85 else
appl/cmd/mouse.b+2−2
@@ -49,8 +49,8 @@ init(nil: ref Draw->Context, argv: list of string) · 48 unmodified lines
49 usage();49 usage();
50 50
51 argv = tl argv;51 argv = tl argv;
52 def := 0;52
53 baud := 0;53
54 while (argv != nil && len (arg := hd argv) > 1 && arg[0] == '-') {54 while (argv != nil && len (arg := hd argv) > 1 && arg[0] == '-') {
55 case arg[1] {55 case arg[1] {
56 'D' =>56 'D' =>
appl/cmd/mv.b+0−1
@@ -113,7 +113,6 @@ mv(from,todir,toelem : string): int · 112 unmodified lines
113 sys->fprint(stderr, "mv: can't open %s: %r\n", fromname);113 sys->fprint(stderr, "mv: can't open %s: %r\n", fromname);
114 return -1;114 return -1;
115 }115 }
116 (j,dirt):=sys->stat(toname);
117 fdt := sys->create(toname, Sys->OWRITE, dirb.mode);116 fdt := sys->create(toname, Sys->OWRITE, dirb.mode);
118 if(fdt == nil){117 if(fdt == nil){
119 sys->fprint(stderr, "mv: can't create %s: %r\n", toname);118 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
52server(fio: ref Sys->FileIO, data: array of byte)52server(fio: ref Sys->FileIO, data: array of byte)
53{53{
54 for (;;) alt {54 for (;;) alt {
55 (offset, count, fid, rc) := <-fio.read =>55 (offset, count, nil, rc) := <-fio.read =>
56 if (rc != nil) {56 if (rc != nil) {
57 if (offset > len data)57 if (offset > len data)
58 rc <-= (nil, nil);58 rc <-= (nil, nil);
@@ -63,7 +63,7 @@ server(fio: ref Sys->FileIO, data: array of byte) · 4 unmodified lines
63 rc <-= (data[offset:end], nil);63 rc <-= (data[offset:end], nil);
64 }64 }
65 }65 }
66 (offset, d, fid, wc) := <-fio.write =>66 (offset, d, nil, wc) := <-fio.write =>
67 if (wc != nil) {67 if (wc != nil) {
68 if (offset == 0)68 if (offset == 0)
69 data = array[0] of byte;69 data = array[0] of byte;
appl/cmd/rcmd.b+1−1
@@ -141,7 +141,7 @@ netmkaddr(addr, net, svc: string): string · 140 unmodified lines
141{141{
142 if(net == nil)142 if(net == nil)
143 net = "net";143 net = "net";
144 (n, l) := sys->tokenize(addr, "!");144 (n, nil) := sys->tokenize(addr, "!");
145 if(n <= 1){145 if(n <= 1){
146 if(svc== nil)146 if(svc== nil)
147 return sys->sprint("%s!%s", net, addr);147 return sys->sprint("%s!%s", net, addr);
appl/cmd/stack.b+2−2
@@ -155,7 +155,7 @@ stdsym(m: ref Module) · 154 unmodified lines
155 }155 }
156 if(dism != nil && (sp := dism->src(dis)) != nil){156 if(dism != nil && (sp := dism->src(dis)) != nil){
157 sp = sp[0: len sp - 1] + "sbl";157 sp = sp[0: len sp - 1] + "sbl";
158 (sym, err) := debug->sym(sp);158 (sym, nil) := debug->sym(sp);
159 if (sym != nil) {159 if (sym != nil) {
160 m.addsym(sym);160 m.addsym(sym);
161 return;161 return;
@@ -167,7 +167,7 @@ stdsym(m: ref Module) · 5 unmodified lines
167 sblpath = sblpath + dis[len dispath:];167 sblpath = sblpath + dis[len dispath:];
168 if (len sblpath > 4 && sblpath[len sblpath - 4:] == ".dis")168 if (len sblpath > 4 && sblpath[len sblpath - 4:] == ".dis")
169 sblpath = sblpath[0:len sblpath - 4] + ".sbl";169 sblpath = sblpath[0:len sblpath - 4] + ".sbl";
170 (sym, err) := debug->sym(sblpath);170 (sym, nil) := debug->sym(sblpath);
171 if (sym != nil) {171 if (sym != nil) {
172 m.addsym(sym);172 m.addsym(sym);
173 return;173 return;
appl/cmd/stackv.b+2−0
@@ -360,6 +360,8 @@ plist(exp: ref Exp, v: string, w: int, depth: int) · 359 unmodified lines
360 while(w && v != "nil"){360 while(w && v != "nil"){
361 exps := exp.expand();361 exps := exp.expand();
362 h := getname(exps, "hd");362 h := getname(exps, "hd");
363 if(h == nil)
364 break;
363 (hv, vw) := h.val();365 (hv, vw) := h.val();
364 if(pref(v) == 0)366 if(pref(v) == 0)
365 return;367 return;
appl/cmd/styxchat.b+1−1
@@ -111,7 +111,7 @@ netmkaddr(addr, net, svc: string): string · 110 unmodified lines
111{111{
112 if(net == nil)112 if(net == nil)
113 net = "net";113 net = "net";
114 (n, l) := sys->tokenize(addr, "!");114 (n, nil) := sys->tokenize(addr, "!");
115 if(n <= 1){115 if(n <= 1){
116 if(svc== nil)116 if(svc== nil)
117 return sys->sprint("%s!%s", net, addr);117 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
250{250{
251 if(net == nil)251 if(net == nil)
252 net = "net";252 net = "net";
253 (n, l) := sys->tokenize(addr, "!");253 (n, nil) := sys->tokenize(addr, "!");
254 if(n <= 1){254 if(n <= 1){
255 if(svc== nil)255 if(svc== nil)
256 return sys->sprint("%s!%s", net, addr);256 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
57 else {57 else {
58 if((file=sys->open(hd argv,sys->OREAD)) == nil )58 if((file=sys->open(hd argv,sys->OREAD)) == nil )
59 fatal(hd argv);59 fatal(hd argv);
60 (ok, stat) := sys->fstat(file);60 (nil, stat) := sys->fstat(file);
61 seekable = sys->seek(file,big 0,sys->SEEKSTART) == big 0 && stat.length > big 0;61 seekable = sys->seek(file,big 0,sys->SEEKSTART) == big 0 && stat.length > big 0;
62 }62 }
63 63
@@ -99,7 +99,7 @@ init(nil: ref Draw->Context, argv: list of string) · 35 unmodified lines
99 99
100trunc(length : big) : sys->Dir100trunc(length : big) : sys->Dir
101{101{
102 (i,d):=sys->fstat(file);102 (nil,d):=sys->fstat(file);
103 if(d.length < length)103 if(d.length < length)
104 d.length = tseek(big 0, sys->SEEKSTART);104 d.length = tseek(big 0, sys->SEEKSTART);
105 return d;105 return d;
appl/cmd/telnet.b+1−1
@@ -470,7 +470,7 @@ netmkaddr(addr, net, svc: string): string · 469 unmodified lines
470{470{
471 if(net == nil)471 if(net == nil)
472 net = "net";472 net = "net";
473 (n, l) := sys->tokenize(addr, "!");473 (n, nil) := sys->tokenize(addr, "!");
474 if(n <= 1){474 if(n <= 1){
475 if(svc== nil)475 if(svc== nil)
476 return sys->sprint("%s!%s", net, addr);476 return sys->sprint("%s!%s", net, addr);
appl/cmd/tsort.b+1−1
@@ -60,7 +60,7 @@ input() · 59 unmodified lines
60{60{
61 b := bufio->fopen(sys->fildes(0), Sys->OREAD);61 b := bufio->fopen(sys->fildes(0), Sys->OREAD);
62 while((line := b.gets('\n')) != nil){62 while((line := b.gets('\n')) != nil){
63 (nf, fld) := sys->tokenize(line, " \t\n");63 (nil, fld) := sys->tokenize(line, " \t\n");
64 if(fld != nil){64 if(fld != nil){
65 a := finditem(hd fld);65 a := finditem(hd fld);
66 while((fld = tl fld) != nil)66 while((fld = tl fld) != nil)
appl/cmd/xmount.b+1−1
@@ -219,7 +219,7 @@ netmkaddr(addr, net, svc: string): string · 218 unmodified lines
219{219{
220 if(net == nil)220 if(net == nil)
221 net = "net";221 net = "net";
222 (n, l) := sys->tokenize(addr, "!");222 (n, nil) := sys->tokenize(addr, "!");
223 if(n <= 1){223 if(n <= 1){
224 if(svc== nil)224 if(svc== nil)
225 return sys->sprint("%s!%s", net, addr);225 return sys->sprint("%s!%s", net, addr);
appl/cmd/yacc.b+0−1
@@ -781,7 +781,6 @@ gettok(): int · 780 unmodified lines
781 781
782 tokname = "";782 tokname = "";
783 for(;;){783 for(;;){
784 reserve := 0;
785 lineno += peekline;784 lineno += peekline;
786 peekline = 0;785 peekline = 0;
787 c = finput.getc();786 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
181it to backslash escaped hex if necessary.181it to backslash escaped hex if necessary.
182.RE182.RE
183.PD183.PD
184There are two other commands:184Other commands include:
185.TP 10185.TP 10
186.RB [ ?/ ] w\ \fIvalue\fP186.RB [ ?/ ] w\ \fIvalue\fP
187Write the two-byte187Write the two-byte
@@ -192,8 +192,51 @@ to the addressed location. · 4 unmodified lines
192Write the four-byte192Write the four-byte
193.I value193.I value
194to the addressed location.194to the addressed location.
195.TP
196.RB [ ?/ ] i
197Disassemble
198.I count
199instructions starting at
200.I address
201.RI ( dot
202by default).
203.TP
204.BI $ modifier
205.I File
206must be a
207.IR dis (6)
208file.
209.I Modifier
210is one of the following subcommands:
211.RS
212.TP
213.PD 0
214.B D
215Print the descriptor section.
216.TP
217.B h
218Print the file header.
219.TP
220.B l
221Print the links section.
222.TP
223.B i
224Print the import section.
225.TP
226.B d
227Print the data section.
228.TP
229.B H
230Print exception handler tables.
231.TP
232.B s
233Print the name of the source file.
234.PD
235.RE
195.SH SOURCE236.SH SOURCE
196.B /appl/cmd/mdb.b237.B /appl/cmd/mdb.b
238.SH SEE ALSO
239.IR dis (6)
197.SH BUGS240.SH BUGS
198Most of the more useful features of241Most of the more useful features of
199.IR mdb 's242.IR mdb 's

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t