Change record vmevent parameters. Dump function id on FUNC*.

This commit is contained in:
Mike Pall 2010-02-15 22:26:33 +01:00
parent e1905f498a
commit e664945e0b
2 changed files with 18 additions and 18 deletions

View File

@ -483,15 +483,21 @@ local function dump_record(tr, func, pc, depth, callee)
recdepth = depth recdepth = depth
recprefix = rep(" .", depth) recprefix = rep(" .", depth)
end end
local line = bcline(func, pc, recprefix) local line
if pc >= 0 then
line = bcline(func, pc, recprefix)
if dumpmode.H then line = gsub(line, "[<>&]", html_escape) end if dumpmode.H then line = gsub(line, "[<>&]", html_escape) end
if type(callee) == "function" then else
out:write(sub(line, 1, -2), " ; ", fmtfunc(callee), "\n") line = "0000 "..recprefix.." FUNCC \n"
callee = func
end
if pc <= 0 then
out:write(sub(line, 1, -2), " ; ", fmtfunc(func), "\n")
else else
out:write(line) out:write(line)
end end
if band(funcbc(func, pc), 0xff) < 16 then -- Write JMP for cond. ORDER BC if pc >= 0 and band(funcbc(func, pc), 0xff) < 16 then -- ORDER BC
out:write(bcline(func, pc+1, recprefix)) out:write(bcline(func, pc+1, recprefix)) -- Write JMP for cond.
end end
end end

View File

@ -475,17 +475,11 @@ static TValue *trace_state(lua_State *L, lua_CFunction dummy, void *ud)
case LJ_TRACE_RECORD: case LJ_TRACE_RECORD:
setvmstate(J2G(J), RECORD); setvmstate(J2G(J), RECORD);
if (J->pt)
lj_vmevent_send(L, RECORD, lj_vmevent_send(L, RECORD,
setintV(L->top++, J->curtrace); setintV(L->top++, J->curtrace);
setfuncV(L, L->top++, J->fn); setfuncV(L, L->top++, J->fn);
setintV(L->top++, proto_bcpos(J->pt, J->pc)); setintV(L->top++, J->pt ? (int32_t)proto_bcpos(J->pt, J->pc) : -1);
setintV(L->top++, J->framedepth); setintV(L->top++, J->framedepth);
if (bcmode_mm(bc_op(*J->pc)) == MM_call) {
cTValue *o = &L->base[bc_a(*J->pc)];
if (bc_op(*J->pc) == BC_ITERC) o -= 3;
copyTV(L, L->top++, o);
}
); );
lj_record_ins(J); lj_record_ins(J);
break; break;