Show cell type name in writeCell
This commit is contained in:
parent
d6ab21eed5
commit
44ff8baf2a
1 changed files with 11 additions and 5 deletions
|
|
@ -153,13 +153,19 @@ template setColor(c, col) =
|
||||||
|
|
||||||
proc writeCell(msg: cstring, c: PCell) =
|
proc writeCell(msg: cstring, c: PCell) =
|
||||||
var kind = -1
|
var kind = -1
|
||||||
if c.typ != nil: kind = ord(c.typ.kind)
|
var typName: cstring = "nil"
|
||||||
|
if c.typ != nil:
|
||||||
|
kind = ord(c.typ.kind)
|
||||||
|
when defined(nimTypeNames):
|
||||||
|
if not c.typ.name.isNil:
|
||||||
|
typName = c.typ.name
|
||||||
|
|
||||||
when leakDetector:
|
when leakDetector:
|
||||||
c_fprintf(stdout, "[GC] %s: %p %d rc=%ld from %s(%ld)\n",
|
c_fprintf(stdout, "[GC] %s: %p %d %s rc=%ld from %s(%ld)\n",
|
||||||
msg, c, kind, c.refcount shr rcShift, c.filename, c.line)
|
msg, c, kind, typName, c.refcount shr rcShift, c.filename, c.line)
|
||||||
else:
|
else:
|
||||||
c_fprintf(stdout, "[GC] %s: %p %d rc=%ld; color=%ld\n",
|
c_fprintf(stdout, "[GC] %s: %p %d %s rc=%ld; color=%ld\n",
|
||||||
msg, c, kind, c.refcount shr rcShift, c.color)
|
msg, c, kind, typName, c.refcount shr rcShift, c.color)
|
||||||
|
|
||||||
template gcTrace(cell, state: expr): stmt {.immediate.} =
|
template gcTrace(cell, state: expr): stmt {.immediate.} =
|
||||||
when traceGC: traceCell(cell, state)
|
when traceGC: traceCell(cell, state)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue