- , , LLVM. , , --debug. :
inlined , .
3.times do |i|
pp i
end
pp name => value.
pp i
i => 1
i => 2
i => 3
debugger {% debug() %} $ crystal tool expand.
, , GDB.
i = 0
while i < 3
debugger
i += 1
end
, , .
- : try
@[NoInline] p &foo.c, args,
@[NoInline]:
@[NoInline]
def do(foo)
debugger
end
GDB:
(gdb) p &foo.c
$1 = (UInt8 *) 0x10008e6c4 "HI"
: , LLVM . <optimized out>, @[NoInline] vars vars array = @array
: self.var, , vars.
p array.buffer[0]@size .
(gdb) p &array.buffer[0].c
$19 = (UInt8 *) 0x10008e7f4 "HI"
- : , .
:
@[NoInline]
def do(foo)
html = bar(foo).as(String)
html = bar(foo).to_s
debugger
end
html var GDB .as .to_s
(gdb) p &html.c
$1 = (UInt8 *) 0x1002fcfec "hihi"