diff options
Diffstat (limited to 'gdb/testsuite/gdb.python/py-objfile.exp')
-rw-r--r-- | gdb/testsuite/gdb.python/py-objfile.exp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.python/py-objfile.exp b/gdb/testsuite/gdb.python/py-objfile.exp index 74384ed..6c36f8e 100644 --- a/gdb/testsuite/gdb.python/py-objfile.exp +++ b/gdb/testsuite/gdb.python/py-objfile.exp @@ -61,3 +61,29 @@ 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" + +# Now build another copy of the testcase, this time without debug info. + +if { [prepare_for_testing ${testfile}.exp ${testfile}2 ${srcfile} {nodebug ldflags=-Wl,--strip-debug}] } { + return -1 +} + +if ![runto_main] { + fail "Can't run to main" + return 0 +} + +gdb_py_test_silent_cmd "python objfile = gdb.objfiles()\[0\]" \ + "Get no-debug objfile file" 1 + +gdb_test "p main" "= {<text variable, no debug info>} $hex <main>" \ + "print main without debug info" + +gdb_py_test_silent_cmd "python objfile.add_separate_debug_file(\"${binfile}\")" \ + "Add separate debug file file" 1 + +gdb_py_test_silent_cmd "python sep_objfile = gdb.objfiles()\[0\]" \ + "Get separate debug info objfile" 1 + +gdb_test "p main" "= {int \\(\\)} $hex <main>" \ + "print main with debug info" |