aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.python')
-rw-r--r--gdb/testsuite/gdb.python/py-events.exp6
-rw-r--r--gdb/testsuite/gdb.python/py-events.py1
-rw-r--r--gdb/testsuite/gdb.python/py-type.exp5
3 files changed, 10 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.python/py-events.exp b/gdb/testsuite/gdb.python/py-events.exp
index 18d3380..d872daf 100644
--- a/gdb/testsuite/gdb.python/py-events.exp
+++ b/gdb/testsuite/gdb.python/py-events.exp
@@ -85,10 +85,12 @@ delete_breakpoints
gdb_test "continue" ".*event type: continue.*
.*event type: exit.*
.*exit code: 12.*
-.*exit inf: 1.*" "Inferior 1 terminated."
+.*exit inf: 1.*
+dir ok: True.*" "Inferior 1 terminated."
gdb_test "inferior 2" ".*Switching to inferior 2.*"
gdb_test "continue" ".*event type: continue.*
.*event type: exit.*
.*exit code: 12.*
-.*exit inf: 2.*" "Inferior 2 terminated."
+.*exit inf: 2.*
+dir ok: True.*" "Inferior 2 terminated."
diff --git a/gdb/testsuite/gdb.python/py-events.py b/gdb/testsuite/gdb.python/py-events.py
index 122def0..f7e45f5 100644
--- a/gdb/testsuite/gdb.python/py-events.py
+++ b/gdb/testsuite/gdb.python/py-events.py
@@ -44,6 +44,7 @@ def exit_handler (event):
print "event type: exit"
print "exit code: %d" % (event.exit_code)
print "exit inf: %d" % (event.inferior.num)
+ print "dir ok: %s" % str('exit_code' in dir(event))
def continue_handler (event):
if (isinstance (event, gdb.ContinueEvent)):
diff --git a/gdb/testsuite/gdb.python/py-type.exp b/gdb/testsuite/gdb.python/py-type.exp
index e4729ad..feb76ba 100644
--- a/gdb/testsuite/gdb.python/py-type.exp
+++ b/gdb/testsuite/gdb.python/py-type.exp
@@ -86,6 +86,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"