2011-10-20 Phil Muldoon <pmuldoon@redhat.com>
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.python / py-block.exp
index 98b89d9d2032a23cd9afe796f447c730420577d1..6a4edf020c55b4857243dd230a4b4fa9a667213f 100644 (file)
@@ -48,6 +48,16 @@ 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"
 
+# Test global/static blocks
+gdb_py_test_silent_cmd "python frame = gdb.selected_frame()" "Get Frame" 0
+gdb_py_test_silent_cmd "python block = frame.block()" "Get block" 0
+gdb_test "python print block.is_global" "False" "Not a global block"
+gdb_test "python print block.is_static" "False" "Not a static block"
+gdb_py_test_silent_cmd "python gblock = block.global_block" "Get block" 1
+gdb_py_test_silent_cmd "python sblock = block.static_block" "Get block" 1
+gdb_test "python print gblock.is_global" "True" "Is the global block"
+gdb_test "python print sblock.is_static" "True" "Is the static block"
+
 # Move up superblock(s) until we reach function block_func.
 gdb_test_no_output "python block = block.superblock" "Get superblock"
 gdb_test "python print block.function" "None" "Second anonymous block"
This page took 0.024175 seconds and 4 git commands to generate.