diff options
Diffstat (limited to 'gdb/testsuite/gdb.python/py-symtab.exp')
-rw-r--r-- | gdb/testsuite/gdb.python/py-symtab.exp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.python/py-symtab.exp b/gdb/testsuite/gdb.python/py-symtab.exp index 4765ef5..18d77a0 100644 --- a/gdb/testsuite/gdb.python/py-symtab.exp +++ b/gdb/testsuite/gdb.python/py-symtab.exp @@ -90,6 +90,34 @@ gdb_test_multiple "python print (\"simple_struct\" in static_symbols)" \ } } +# Test symtab identity +gdb_test "python print (symtab is symtab)"\ + "True" \ + "test symtab identity 1" +gdb_test "python print (symtab is gdb.selected_frame().find_sal().symtab)"\ + "True" \ + "test symtab identity 2" +gdb_test "python print (sal.symtab is gdb.selected_frame().find_sal().symtab)"\ + "True" \ + "test symtab identity 3" +gdb_test "python print (symtab is not \"xxx\")"\ + "True" \ + "test symtab non-identity with non-symtab" + +# Test symtab equality +gdb_test "python print (symtab == symtab)"\ + "True" \ + "test symtab equality 1" +gdb_test "python print (symtab == gdb.selected_frame().find_sal().symtab)"\ + "True" \ + "test symtab equality 2" +gdb_test "python print (sal.symtab == gdb.selected_frame().find_sal().symtab)"\ + "True" \ + "test symtab equality 3" +gdb_test "python print (symtab != \"xxx\")"\ + "True" \ + "test symtab non-equality with non-symtab" + # Test is_valid when the objfile is unloaded. This must be the last # test as it unloads the object file in GDB. gdb_unload |