diff options
Diffstat (limited to 'gdb/testsuite/gdb.python')
-rw-r--r-- | gdb/testsuite/gdb.python/py-objfile.exp | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.python/py-progspace.exp | 12 |
2 files changed, 16 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.python/py-objfile.exp b/gdb/testsuite/gdb.python/py-objfile.exp index 8796170..7bf41ed 100644 --- a/gdb/testsuite/gdb.python/py-objfile.exp +++ b/gdb/testsuite/gdb.python/py-objfile.exp @@ -46,3 +46,8 @@ gdb_test "python print (objfile.is_valid())" "True" \ gdb_unload gdb_test "python print (objfile.is_valid())" "False" \ "Get objfile validity after unload" + +gdb_py_test_silent_cmd "python objfile.random_attribute = 42" \ + "Set random attribute in objfile" 1 +gdb_test "python print (objfile.random_attribute)" "42" \ + "Verify set of random attribute in objfile" diff --git a/gdb/testsuite/gdb.python/py-progspace.exp b/gdb/testsuite/gdb.python/py-progspace.exp index 2fcfdb9..a47fae6 100644 --- a/gdb/testsuite/gdb.python/py-progspace.exp +++ b/gdb/testsuite/gdb.python/py-progspace.exp @@ -16,6 +16,8 @@ # This file is part of the GDB testsuite. It tests the program space # support in Python. +load_lib gdb-python.exp + standard_testfile if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} { @@ -37,5 +39,13 @@ gdb_test "python print (gdb.progspaces())" "\\\[<gdb.Progspace object at $hex>\\ gdb_load ${binfile} -gdb_test "python print (gdb.current_progspace().filename)" "py-progspace" \ +gdb_py_test_silent_cmd "python progspace = gdb.current_progspace()" \ + "Get current progspace" 1 + +gdb_test "python print (progspace.filename)" "py-progspace" \ "current progspace filename (py-progspace)" + +gdb_py_test_silent_cmd "python progspace.random_attribute = 42" \ + "Set random attribute in progspace" 1 +gdb_test "python print (progspace.random_attribute)" "42" \ + "Verify set of random attribute in progspace" |