diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-02-12 19:27:08 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-02-12 19:27:08 +0100 |
commit | cd170777496fbf57ed923f8640437464e286a1e1 (patch) | |
tree | cea3189c73c276554f2b50b9de2d9af9400ec50e /sys/lib/acid | |
parent | ad38f0eb1cce3ea298b4641af13a070e224f9ade (diff) |
truss: support for amd64
Diffstat (limited to 'sys/lib/acid')
-rw-r--r-- | sys/lib/acid/syscall | 4 | ||||
-rw-r--r-- | sys/lib/acid/truss | 15 |
2 files changed, 12 insertions, 7 deletions
diff --git a/sys/lib/acid/syscall b/sys/lib/acid/syscall index 762c89b01..003e8c6ec 100644 --- a/sys/lib/acid/syscall +++ b/sys/lib/acid/syscall @@ -150,6 +150,8 @@ defn UPCSPRET() { // return sys call number, address of first argument, location of syscall return value if objtype == "386" then return { code(*(*PC-4)), code(*SP+4), code(*AX) }; + if objtype == "amd64" then + return { code(*BP), code(*SP+8), code(*AX) }; if (objtype == "mips") || (objtype == "mips2") then return { code(*(*PC-4) & 0xffff), code(*SP+4), code(*R1) }; if objtype == "arm" then @@ -161,6 +163,7 @@ defn UPCSPRET() { defn trapoffset() { // return offset from entry point to trap instr if objtype == "386" then return 5; + if objtype == "amd64" then return 12; if objtype == "mips" then return 8; if objtype == "mips2" then return 8; if objtype == "arm" then return 8; // untested @@ -170,6 +173,7 @@ defn trapoffset() { defn trapreason() { // return reason for trap if objtype == "386" then return reason(*TRAP); + if objtype == "amd64" then return reason(*TYPE); if objtype == "mips" then return reason(*CAUSE); if objtype == "mips2" then return reason(*CAUSE); if objtype == "arm" then return "unknown trap"; // untested diff --git a/sys/lib/acid/truss b/sys/lib/acid/truss index c7cf327ca..1e0689dcb 100644 --- a/sys/lib/acid/truss +++ b/sys/lib/acid/truss @@ -198,7 +198,7 @@ defn new() { } defn truss() { - local pc, lst, offset, prevpc, pcspret, ret; + local pc, lst, offset, prevpc, pcspret, arg, ret; offset = trapoffset(); @@ -225,33 +225,34 @@ defn truss() { trussflush(); prevpc = *PC; step(); + arg = eval pcspret[1]; ret = eval pcspret[2]; print("\treturn value: ", ret\D, "\n"); if (ret>=0) && (match(prevpc, readPC)>=0) then { print("\tdata: "); - printtextordata(*((eval pcspret[1])+4), ret); + printtextordata(arg[1], ret); print("\n"); } if (ret>=0) && (match(prevpc, fd2pathPC)>=0) then { - print("\tdata: \"", *(*((eval pcspret[1])+4)\s), "\"\n"); + print("\tdata: \"", *(arg[1]\s), "\"\n"); } if (ret>=0) && (match(prevpc, errstrPC)>=0) then { - print("\tdata: \"", *(*(eval pcspret[1])\s), "\"\n"); + print("\tdata: \"", *(arg[1]\s), "\"\n"); } if (ret>=0) && (match(prevpc, awaitPC)>=0) then { print("\tdata: "); - printtextordata(*(eval pcspret[1]), ret); + printtextordata(arg[0], ret); print("\n"); } // compatibility hacks for old kernel: if (ret>=0) && (match(prevpc, _waitPC)>=0) then { print("\tdata: "); - printtextordata(*(eval pcspret[1]), 12+3*12+64); + printtextordata(arg[0], 12+3*12+64); print("\n"); } if (ret>=0) && (match(prevpc, _errstrPC)>=0) then { print("\tdata: "); - printtextordata(*(eval pcspret[1]), 64); + printtextordata(arg[0], 64); print("\n"); } } |