diff options
author | rsc <devnull@localhost> | 2005-11-28 00:40:31 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-11-28 00:40:31 +0000 |
commit | 7468541674bc7bfe8c741a6ea997faab1b7b78ba (patch) | |
tree | eaad5a7d3644f3d7918f71998bc8945f987eb5f1 /acid/port | |
parent | 88c6062214c07dabeb7e9625aaccb3d45ed5d71c (diff) | |
download | plan9port-7468541674bc7bfe8c741a6ea997faab1b7b78ba.tar.gz plan9port-7468541674bc7bfe8c741a6ea997faab1b7b78ba.tar.bz2 plan9port-7468541674bc7bfe8c741a6ea997faab1b7b78ba.zip |
process control
Diffstat (limited to 'acid/port')
-rw-r--r-- | acid/port | 33 |
1 files changed, 28 insertions, 5 deletions
@@ -326,6 +326,16 @@ defn bpdel(addr) // delete a breakpoint { local n, pc, nbplist; + if addr == 0 then { + while bplist do { + pc = head bplist; + pc = fmt(pc, bpfmt); + *pc = @pc; + bplist = tail bplist; + } + return {}; + } + n = match(addr, bplist); if n < 0 then { print("no breakpoint at ", fmt(addr, 'a'), "\n"); @@ -360,6 +370,7 @@ defn cont() // continue execution defn stopped(pid) // called from acid when a process changes state { + pfixstop(pid); pstop(pid); // stub so this is easy to replace } @@ -472,14 +483,22 @@ defn win2() stopped(npid); } +printstopped = 1; defn new() { + local a; + bplist = {}; newproc(progargs); - // Dont miss the delay slot calls - bpset(follow(main)[0]); - cont(); - bpdel(*PC); + a = var("p9main"); + if a == {} then + a = var("main"); + if a == {} then + return {}; + bpset(a); + while *PC != a do + cont(); + bpdel(a); } defn stmnt() // step one statement @@ -517,10 +536,14 @@ defn func() // step until we leave the current function defn next() { - local sp, bound; + local sp, bound, pc; sp = *SP; bound = fnbound(*PC); + if bound == {} then { + print("cannot locate text symbol\n"); + return {}; + } stmnt(); pc = *PC; if pc >= bound[0] && pc < bound[1] then |