1 // support for acme; acid must be run with /acme/acid/$cputype/Acid
8 printto("/tmp/acme.acid", eval code);
9 rc("cat /tmp/acme.acid | wnew -d "+"Acid/-stk'("+itoa(pid)+")'");
12 defn procstk(pid, name)
16 printto("/tmp/acme.acid", stk());
17 rc("cat /tmp/acme.acid | wnew -d "+"Acid/-'"+name+"("+itoa(pid)+")'");
20 defn taskstk(tid, name)
24 printto("/tmp/acme.acid", threadstk(tid));
25 rc("cat /tmp/acme.acid | wnew -d "+"Acid/-"+name+"'("+itoa(pid)+")'");
28 defn _stk(pc, sp, link, dolocals)
32 print("At pc:", pc, ":", fmt(pc, 'a'), " ");
35 stk = strace(pc, sp, link);
39 print(fmt(frame[0], 'a'), "(");
40 params(frame[2], frame[0]);
42 print("\n\tcalled from ", fmt(frame[1], 'a'), " ");
46 locals(frame[3], frame[0]);
50 //defn _stk(pc, sp, dolocals)
52 // w(__stk(pc, sp, dolocals));
56 defn params(param, name)
60 print("*", fmt(name, 'a'), ":", sym[0], "=", sym[1]);
73 print("\t*", fmt(name, 'a'), ":", sym[0], "=", sym[1], "\n");
78 defn bptab() // print a table of breakpoints
85 print("\tbpdel(", fmt(addr, 'a'), ")\n");
90 defn procs() // print status of processes
101 print("\t", "setproc(", np, ")\t", status(np), " at ", fmt(*PC, 'a'), "\n");
109 defn allstacks() // print stacks of processes and threads
118 Tq = (Tqueue)P.threads;
119 T = (Thread)Tq.$head;
122 if(T.cmdname == 0) then taskstk(T, "unknown");
123 else taskstk(T, *(T.cmdname\s));
133 print("/sys/lib/acid/acme");