diff options
Diffstat (limited to 'gdb/testsuite/gdb.python/py-block.exp')
-rw-r--r-- | gdb/testsuite/gdb.python/py-block.exp | 38 |
1 files changed, 35 insertions, 3 deletions
diff --git a/gdb/testsuite/gdb.python/py-block.exp b/gdb/testsuite/gdb.python/py-block.exp index 3bdf972..37e3105 100644 --- a/gdb/testsuite/gdb.python/py-block.exp +++ b/gdb/testsuite/gdb.python/py-block.exp @@ -38,7 +38,8 @@ gdb_continue_to_breakpoint "Block break here." gdb_py_test_silent_cmd "python frame = gdb.selected_frame()" "Get Frame" 0 gdb_py_test_silent_cmd "python block = frame.block()" \ "Get block, initial innermost block" 0 -gdb_test "python print (block)" "<gdb.Block object at $hex>" "check block not None" +gdb_test "python print (block)" "<gdb.Block <anonymous> \{i, f, b\}>" \ + "check block not None" gdb_test "python print (block.function)" "None" "first anonymous block" gdb_test "python print (block.start)" "${decimal}" "check start not None" gdb_test "python print (block.end)" "${decimal}" "check end not None" @@ -68,15 +69,46 @@ gdb_test_no_output "python block = block.superblock" "get superblock 2" gdb_test "python print (block.function)" "block_func" \ "Print superblock 2 function" +# Switch frames, then test block for no_locals_func. +gdb_test "continue" ".*" "continue to no_locals_func breakpoint" +gdb_test "up" ".*" "up to no_locals_func" +gdb_py_test_silent_cmd "python frame = gdb.selected_frame()" "Get Frame 2" 0 +gdb_py_test_silent_cmd "python block = frame.block()" "Get Frame 2's block" 0 +gdb_test "python print (repr (block))" "<gdb.Block no_locals_func \{\}>" \ + "Check block in no_locals_func" +gdb_test "python print (block.function)" "no_locals_func" \ + "no_locals_func block" + +# Switch frames, then test block for few_locals_func. +gdb_test "continue" ".*" "continue to few_locals_func breakpoint" +gdb_test "up" ".*" "up to few_locals_func" +gdb_py_test_silent_cmd "python frame = gdb.selected_frame()" "Get Frame 2" 0 +gdb_py_test_silent_cmd "python block = frame.block()" "Get Frame 2's block" 0 +gdb_test "python print (repr (block))" \ + "<gdb.Block few_locals_func \{i, j, k, x, y\}>" \ + "Check block in few_locals_func" +gdb_test "python print (block.function)" "few_locals_func" \ + "few_locals_func block" + +# Switch frames, then test block for many_locals_func. +gdb_test "continue" ".*" "continue to many_locals_func breakpoint" +gdb_test "up" ".*" "up to many_locals_func" +gdb_py_test_silent_cmd "python frame = gdb.selected_frame()" "Get Frame 2" 0 +gdb_py_test_silent_cmd "python block = frame.block()" "Get Frame 2's block" 0 +gdb_test "python print (repr (block))" \ + "<gdb.Block many_locals_func \{i, j, k, x, y, \\.\\.\\. \\(1 more symbol\\)\}>" \ + "Check block in many_locals_func" +gdb_test "python print (block.function)" "many_locals_func" \ + "many_locals_func block" + # Switch frames, then test for main block. gdb_test "up" ".*" gdb_py_test_silent_cmd "python frame = gdb.selected_frame()" "Get Frame 2" 0 gdb_py_test_silent_cmd "python block = frame.block()" "Get Frame 2's block" 0 -gdb_test "python print (block)" "<gdb.Block object at $hex>" \ +gdb_test "python print (repr (block))" "<gdb.Block main \{.*\}>" \ "Check Frame 2's block not None" gdb_test "python print (block.function)" "main" "main block" - # Test Block is_valid. This must always be the last test in this # testcase as it unloads the object file. delete_breakpoints |