aboutsummaryrefslogtreecommitdiff
path: root/acid/386
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-11-28 00:40:31 +0000
committerrsc <devnull@localhost>2005-11-28 00:40:31 +0000
commit7468541674bc7bfe8c741a6ea997faab1b7b78ba (patch)
treeeaad5a7d3644f3d7918f71998bc8945f987eb5f1 /acid/386
parent88c6062214c07dabeb7e9625aaccb3d45ed5d71c (diff)
downloadplan9port-7468541674bc7bfe8c741a6ea997faab1b7b78ba.tar.gz
plan9port-7468541674bc7bfe8c741a6ea997faab1b7b78ba.tar.bz2
plan9port-7468541674bc7bfe8c741a6ea997faab1b7b78ba.zip
process control
Diffstat (limited to 'acid/386')
-rw-r--r--acid/38635
1 files changed, 31 insertions, 4 deletions
diff --git a/acid/386 b/acid/386
index 29842b65..e9b2f036 100644
--- a/acid/386
+++ b/acid/386
@@ -67,17 +67,44 @@ defn mmregs()
print("MM6\t", *MM6, " MM7\t", *MM7, "\n");
}
+defn pfixstop(pid)
+{
+ if *fmt(*PC-1, 'b') == 0xCC then {
+ // Linux stops us after the breakpoint, not at it
+ *PC = *PC-1;
+ }
+}
+
+
defn pstop(pid)
{
local l;
local pc;
+ local why;
pc = *PC;
- print(pid,": ", reason(*TRAP), "\t");
- print(fmt(pc, 'a'), "\t", *fmt(pc, 'i'), "\n");
-
- if notes then {
+ // FIgure out why we stopped.
+ if *fmt(pc, 'b') == 0xCC then {
+ why = "breakpoint";
+
+ // fix up instruction for print; will put back later
+ *pc = @pc;
+ } else if *(pc-2\x) == 0x80CD then {
+ pc = pc-2;
+ why = "system call";
+ } else
+ why = "stopped";
+
+ if printstopped then {
+ print(pid,": ", why, "\t");
+ print(fmt(pc, 'a'), "\t", *fmt(pc, 'i'), "\n");
+ }
+
+ if why == "breakpoint" then
+ *fmt(pc, bpfmt) = bpinst;
+
+ if printstopped && notes then {
if notes[0] != "sys: breakpoint" then {
print("Notes pending:\n");
l = notes;