| Index: gdb/testsuite/gdb.python/py-type.exp
|
| diff --git a/gdb/testsuite/gdb.python/py-type.exp b/gdb/testsuite/gdb.python/py-type.exp
|
| index 66782b126d94bc2ee15c019c6bf5a862f23171e0..98a055e06ebb0504c8086cfd85115e14009ba0ce 100644
|
| --- a/gdb/testsuite/gdb.python/py-type.exp
|
| +++ b/gdb/testsuite/gdb.python/py-type.exp
|
| @@ -16,17 +16,11 @@
|
| # This file is part of the GDB testsuite. It tests the mechanism
|
| # of exposing types to Python.
|
|
|
| -if $tracelevel then {
|
| - strace $tracelevel
|
| -}
|
| -
|
| load_lib gdb-python.exp
|
|
|
| -set testfile "py-type"
|
| -set srcfile ${testfile}.c
|
| -set binfile ${objdir}/${subdir}/${testfile}
|
| +standard_testfile
|
|
|
| -if [get_compiler_info not-used c++] {
|
| +if [get_compiler_info c++] {
|
| return -1;
|
| }
|
|
|
| @@ -90,6 +84,11 @@ proc test_fields {lang} {
|
| gdb_test "python print fields\[0\].name" "a" "Check structure field a name"
|
| gdb_test "python print fields\[1\].name" "b" "Check structure field b name"
|
|
|
| + # Regression test for
|
| + # http://sourceware.org/bugzilla/show_bug.cgi?id=12070.
|
| + gdb_test "python print 'type' in dir(fields\[0\])" "True" \
|
| + "Check that dir includes name"
|
| +
|
| # Test Python mapping behavior of gdb.Type for structs/classes
|
| gdb_test "python print len(st.type)" "2" "Check number of fields"
|
| gdb_test "python print st.type\['a'\].name" "a" "Check fields lookup by name"
|
| @@ -135,8 +134,8 @@ proc test_enums {} {
|
| gdb_test "python print len(e.type)" "3" "Check the number of enum fields"
|
| gdb_test "python print e.type\['v1'\].name" "v1" "Check enum field lookup by name"
|
| gdb_test "python print e.type\['v3'\].name" "v3" "Check enum field lookup by name"
|
| - gdb_test "python print \[v.bitpos for v in e.type.itervalues()\]" {\[0L, 1L, 2L\]} "Check num fields iteration over values"
|
| - gdb_test "python print \[(n, v.bitpos) for (n, v) in e.type.items()\]" {\[\('v1', 0L\), \('v2', 1L\), \('v3', 2L\)\]} "Check enum fields items list"
|
| + gdb_test "python print \[v.enumval for v in e.type.itervalues()\]" {\[0L, 1L, 2L\]} "Check num fields iteration over values"
|
| + gdb_test "python print \[(n, v.enumval) for (n, v) in e.type.items()\]" {\[\('v1', 0L\), \('v2', 1L\), \('v3', 2L\)\]} "Check enum fields items list"
|
| }
|
| proc test_base_class {} {
|
| gdb_py_test_silent_cmd "print d" "print value" 1
|
| @@ -193,7 +192,10 @@ proc test_template {} {
|
| gdb_test "python print isinstance(ttype.template_argument(1), gdb.Value)" \
|
| "True"
|
|
|
| - setup_kfail "gcc/41736" *-*-*
|
| + if {[test_compiler_info {gcc-[0-3]-*}]
|
| + || [test_compiler_info {gcc-4-[0-5]-*}]} {
|
| + setup_xfail "gcc/46955" *-*-*
|
| + }
|
| gdb_test "python print ttype.template_argument(2)" "&C::c"
|
| }
|
|
|
|
|