From a0be3e44c7f510df608e4a480dd05c173ce280ce Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Mon, 8 Dec 2014 08:50:48 -0800 Subject: New "owner" attribute for gdb.Objfile. gdb/ChangeLog: * NEWS: Mention gdb.Objfile.owner. * python/py-objfile.c (objfpy_get_owner): New function. (objfile_getset): Add "owner". gdb/doc/ChangeLog: * python.texi (Objfiles In Python): Document Objfile.owner. gdb/testsuite/ChangeLog: * gdb.python/py-objfile.exp: Add tests for objfile.owner. --- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.python/py-objfile.exp | 6 ++++++ 2 files changed, 10 insertions(+) (limited to 'gdb/testsuite') diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index c389d7d..0e973f7 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2014-12-08 Doug Evans + + * gdb.python/py-objfile.exp: Add tests for objfile.owner. + 2014-12-05 Yao Qi * gdb.guile/scm-error.exp: Remove the third argument to diff --git a/gdb/testsuite/gdb.python/py-objfile.exp b/gdb/testsuite/gdb.python/py-objfile.exp index 6c36f8e..f3a8a6c 100644 --- a/gdb/testsuite/gdb.python/py-objfile.exp +++ b/gdb/testsuite/gdb.python/py-objfile.exp @@ -76,6 +76,9 @@ if ![runto_main] { gdb_py_test_silent_cmd "python objfile = gdb.objfiles()\[0\]" \ "Get no-debug objfile file" 1 +gdb_test "python print (objfile.owner)" "None" \ + "Test owner of real objfile." + gdb_test "p main" "= {} $hex
" \ "print main without debug info" @@ -85,5 +88,8 @@ gdb_py_test_silent_cmd "python objfile.add_separate_debug_file(\"${binfile}\")" gdb_py_test_silent_cmd "python sep_objfile = gdb.objfiles()\[0\]" \ "Get separate debug info objfile" 1 +gdb_test "python print (sep_objfile.owner.filename)" "${testfile}2" \ + "Test owner of separate debug file" + gdb_test "p main" "= {int \\(\\)} $hex
" \ "print main with debug info" -- cgit v1.1