From d839c8a4e8665e408dfcdf3c8e8cc7f054ade108 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Mon, 23 Aug 2010 20:26:10 +0000 Subject: gdb PR python/10676: * python/py-type.c: Include bcache.h, vec.h. (struct type_equality_entry): New. (compare_strings): New function. (check_types_equal): Likewise. (check_types_worklist): Likewise. (typy_richcompare): Likewise. (type_object_type): Set tp_richcompare field. gdb/testsuite PR python/10676: * gdb.python/py-type.exp (test_fields): Add tests for type equality. --- gdb/testsuite/gdb.python/py-type.exp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gdb/testsuite/gdb.python') diff --git a/gdb/testsuite/gdb.python/py-type.exp b/gdb/testsuite/gdb.python/py-type.exp index 095711f..10bb652 100644 --- a/gdb/testsuite/gdb.python/py-type.exp +++ b/gdb/testsuite/gdb.python/py-type.exp @@ -81,6 +81,10 @@ proc test_fields {lang} { gdb_test "python print len(fields)" "2" "Check number of fields" gdb_test "python print fields\[0\].name" "c" "Check class field c name" gdb_test "python print fields\[1\].name" "d" "Check class field d name" + + gdb_test "python print c.type == gdb.parse_and_eval('d').type" "False" + gdb_test "python print c.type == gdb.parse_and_eval('d').type.fields()\[0\].type" \ + "True" } # Test normal fields usage in structs. @@ -102,6 +106,8 @@ proc test_fields {lang} { ".1, 2." "cast to array with one argument" gdb_test "python print ar\[0\].cast(ar\[0\].type.array(0, 1))" \ ".1, 2." "cast to array with two arguments" + + gdb_test "python print ar\[0\].type == ar\[0\].type" "True" } proc test_base_class {} { -- cgit v1.1