[debug] it's possible to inspect array elements in debugger

This commit is contained in:
Aleksey Kladov
2017-11-17 11:46:58 +03:00
committed by Vasily Levchenko
parent 579e4a0d4c
commit b5befcf5d5
3 changed files with 131 additions and 2 deletions
@@ -133,7 +133,16 @@ private class LldbSessionSpecification private constructor(
&& commands.zip(executedCommands).all { (cmd, h) -> h == "(lldb) $cmd" }
if (!responsesMatch) {
fail("Responses do not match commands.\nResponses: $executedCommands\nCommands: $commands")
val message = """
Responses do not match commands.
COMMANDS: $commands
RESPONSES: $executedCommands
FULL SESSION:
$output
"""
fail(message)
}
for ((patternBody, command) in patterns.zip(bodies).zip(executedCommands)) {
@@ -94,4 +94,20 @@ class LldbTests {
(ObjHeader *) xs = [1, 2, 3]
(ObjHeader *) ys = [Point(x=1, y=2), null]
""")
@Test
fun `can inspect array children`() = lldbTest("""
fun main(args: Array<String>) {
val xs = intArrayOf(3, 5, 8)
return
}
data class Point(val x: Int, val y: Int)
""", """
> type summary add "ObjHeader *" --inline-children
> b main.kt:3
> r
> fr var xs
(ObjHeader *) xs = [..] (0 = 3, 1 = 5, 2 = 8)
""")
}