diff options
| author | Mike Pall <mike> | 2011-06-28 23:23:34 +0200 |
|---|---|---|
| committer | Mike Pall <mike> | 2011-06-28 23:23:34 +0200 |
| commit | deeb8196c4d4085f3cc5a3389b568de7da739190 (patch) | |
| tree | 6b5e9840f785f3fff3348ef1c9aee494cdf06431 /lib | |
| parent | 3dbae4ffc2ba8f6ebf8adf86742521bce6dbf8f8 (diff) | |
| download | luajit-deeb8196c4d4085f3cc5a3389b568de7da739190.tar.gz luajit-deeb8196c4d4085f3cc5a3389b568de7da739190.tar.bz2 luajit-deeb8196c4d4085f3cc5a3389b568de7da739190.zip | |
Reorganize trace linking and track link types.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/dump.lua | 14 | ||||
| -rw-r--r-- | lib/v.lua | 17 |
2 files changed, 19 insertions, 12 deletions
diff --git a/lib/dump.lua b/lib/dump.lua index 5f32eb80..6ada21bc 100644 --- a/lib/dump.lua +++ b/lib/dump.lua | |||
| @@ -504,13 +504,15 @@ local function dump_trace(what, tr, func, pc, otr, oex) | |||
| 504 | if what == "abort" then | 504 | if what == "abort" then |
| 505 | out:write(" ", fmtfunc(func, pc), " -- ", fmterr(otr, oex), "\n") | 505 | out:write(" ", fmtfunc(func, pc), " -- ", fmterr(otr, oex), "\n") |
| 506 | else | 506 | else |
| 507 | local link = traceinfo(tr).link | 507 | local info = traceinfo(tr) |
| 508 | if link == tr then | 508 | local link, ltype = info.link, info.linktype |
| 509 | link = "loop" | 509 | if link == tr or link == 0 then |
| 510 | elseif link == 0 then | 510 | out:write(" -> ", ltype, "\n") |
| 511 | link = "interpreter" | 511 | elseif ltype == "root" then |
| 512 | out:write(" -> ", link, "\n") | ||
| 513 | else | ||
| 514 | out:write(" -> ", link, " ", ltype, "\n") | ||
| 512 | end | 515 | end |
| 513 | out:write(" -> ", link, "\n") | ||
| 514 | end | 516 | end |
| 515 | if dumpmode.H then out:write("</pre>\n\n") else out:write("\n") end | 517 | if dumpmode.H then out:write("</pre>\n\n") else out:write("\n") end |
| 516 | else | 518 | else |
| @@ -22,7 +22,7 @@ | |||
| 22 | -- | 22 | -- |
| 23 | -- The output from the first example should look like this: | 23 | -- The output from the first example should look like this: |
| 24 | -- | 24 | -- |
| 25 | -- [TRACE 1 (command line):1] | 25 | -- [TRACE 1 (command line):1 loop] |
| 26 | -- [TRACE 2 (1/3) (command line):1 -> 1] | 26 | -- [TRACE 2 (1/3) (command line):1 -> 1] |
| 27 | -- | 27 | -- |
| 28 | -- The first number in each line is the internal trace number. Next are | 28 | -- The first number in each line is the internal trace number. Next are |
| @@ -111,15 +111,20 @@ local function dump_trace(what, tr, func, pc, otr, oex) | |||
| 111 | startex, startloc, fmterr(otr, oex))) | 111 | startex, startloc, fmterr(otr, oex))) |
| 112 | end | 112 | end |
| 113 | elseif what == "stop" then | 113 | elseif what == "stop" then |
| 114 | local link = traceinfo(tr).link | 114 | local info = traceinfo(tr) |
| 115 | if link == 0 then | 115 | local link, ltype = info.link, info.linktype |
| 116 | if ltype == "interpreter" then | ||
| 116 | out:write(format("[TRACE %3s %s%s -- fallback to interpreter]\n", | 117 | out:write(format("[TRACE %3s %s%s -- fallback to interpreter]\n", |
| 117 | tr, startex, startloc)) | 118 | tr, startex, startloc)) |
| 118 | elseif link == tr then | 119 | elseif link == tr or link == 0 then |
| 119 | out:write(format("[TRACE %3s %s%s]\n", tr, startex, startloc)) | 120 | out:write(format("[TRACE %3s %s%s %s]\n", |
| 120 | else | 121 | tr, startex, startloc, ltype)) |
| 122 | elseif ltype == "root" then | ||
| 121 | out:write(format("[TRACE %3s %s%s -> %d]\n", | 123 | out:write(format("[TRACE %3s %s%s -> %d]\n", |
| 122 | tr, startex, startloc, link)) | 124 | tr, startex, startloc, link)) |
| 125 | else | ||
| 126 | out:write(format("[TRACE %3s %s%s -> %d %s]\n", | ||
| 127 | tr, startex, startloc, link, ltype)) | ||
| 123 | end | 128 | end |
| 124 | else | 129 | else |
| 125 | out:write(format("[TRACE %s]\n", what)) | 130 | out:write(format("[TRACE %s]\n", what)) |
