diff options
| author | Mike Pall <mike> | 2013-05-13 19:39:34 +0200 |
|---|---|---|
| committer | Mike Pall <mike> | 2013-05-13 19:39:34 +0200 |
| commit | 2ef2c34d84d3e027e828e4726cc90fd55935bd18 (patch) | |
| tree | e04e29b08fd721a704a80b84a4cb56621c1682e4 /src/jit/dump.lua | |
| parent | 2369f5d00ab0a391dd23091af42d893ddceafa76 (diff) | |
| download | luajit-2ef2c34d84d3e027e828e4726cc90fd55935bd18.tar.gz luajit-2ef2c34d84d3e027e828e4726cc90fd55935bd18.tar.bz2 luajit-2ef2c34d84d3e027e828e4726cc90fd55935bd18.zip | |
Adapt -jdump to unified string.format("%x", -1) behavior.
Diffstat (limited to 'src/jit/dump.lua')
| -rw-r--r-- | src/jit/dump.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/jit/dump.lua b/src/jit/dump.lua index 2a7d64e4..e6c9d5b6 100644 --- a/src/jit/dump.lua +++ b/src/jit/dump.lua | |||
| @@ -62,7 +62,7 @@ local traceinfo, traceir, tracek = jutil.traceinfo, jutil.traceir, jutil.tracek | |||
| 62 | local tracemc, tracesnap = jutil.tracemc, jutil.tracesnap | 62 | local tracemc, tracesnap = jutil.tracemc, jutil.tracesnap |
| 63 | local traceexitstub, ircalladdr = jutil.traceexitstub, jutil.ircalladdr | 63 | local traceexitstub, ircalladdr = jutil.traceexitstub, jutil.ircalladdr |
| 64 | local bit = require("bit") | 64 | local bit = require("bit") |
| 65 | local band, shl, shr = bit.band, bit.lshift, bit.rshift | 65 | local band, shl, shr, tohex = bit.band, bit.lshift, bit.rshift, bit.tohex |
| 66 | local sub, gsub, format = string.sub, string.gsub, string.format | 66 | local sub, gsub, format = string.sub, string.gsub, string.format |
| 67 | local byte, char, rep = string.byte, string.char, string.rep | 67 | local byte, char, rep = string.byte, string.char, string.rep |
| 68 | local type, tostring = type, tostring | 68 | local type, tostring = type, tostring |
| @@ -135,6 +135,7 @@ local function dump_mcode(tr) | |||
| 135 | local mcode, addr, loop = tracemc(tr) | 135 | local mcode, addr, loop = tracemc(tr) |
| 136 | if not mcode then return end | 136 | if not mcode then return end |
| 137 | if not disass then disass = require("jit.dis_"..jit.arch) end | 137 | if not disass then disass = require("jit.dis_"..jit.arch) end |
| 138 | if addr < 0 then addr = addr + 2^32 end | ||
| 138 | out:write("---- TRACE ", tr, " mcode ", #mcode, "\n") | 139 | out:write("---- TRACE ", tr, " mcode ", #mcode, "\n") |
| 139 | local ctx = disass.create(mcode, addr, dumpwrite) | 140 | local ctx = disass.create(mcode, addr, dumpwrite) |
| 140 | ctx.hexdump = 0 | 141 | ctx.hexdump = 0 |
| @@ -609,7 +610,7 @@ local function dump_texit(tr, ex, ngpr, nfpr, ...) | |||
| 609 | end | 610 | end |
| 610 | else | 611 | else |
| 611 | for i=1,ngpr do | 612 | for i=1,ngpr do |
| 612 | out:write(format(" %08x", regs[i])) | 613 | out:write(" ", tohex(regs[i])) |
| 613 | if i % 8 == 0 then out:write("\n") end | 614 | if i % 8 == 0 then out:write("\n") end |
| 614 | end | 615 | end |
| 615 | end | 616 | end |
