Skip to content

Commit

Permalink
lj_auditlog.c: Log strings referenced as IR constants
Browse files Browse the repository at this point in the history
The main motivation is to support decoding HREFK constant hashtable
key names.
  • Loading branch information
lukego committed Apr 12, 2018
1 parent b0cbca7 commit 10764c4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/lj_auditlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,21 @@ static void log_jit_State(jit_State *J)

static void log_GCtrace(GCtrace *T)
{
IRRef ref;
log_mem("MCode[]", T->mcode, T->szmcode);
log_mem("SnapShot[]", T->snap, T->nsnap * sizeof(*T->snap));
log_mem("SnapEntry[]", T->snapmap, T->nsnapmap * sizeof(*T->snapmap));
log_mem("IRIns[]", &T->ir[T->nk], (T->nins - T->nk + 1) * sizeof(IRIns));
for (ref = T->nk; ref < REF_TRUE; ref++) {
IRIns *ir = &T->ir[ref];
if (ir->o == IR_KGC) {
GCobj *o = ir_kgc(ir);
/* Log referenced string constants. For e.g. HREFK table keys. */
if (o->gch.gct == ~LJ_TSTR) {
log_GCobj(o);
}
}
}
log_mem("GCtrace", T, sizeof(*T));
}

Expand Down

0 comments on commit 10764c4

Please sign in to comment.