aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2014-12-04 12:01:22 -0800
committerDoug Evans <dje@google.com>2014-12-04 12:01:22 -0800
commit86e4ed39595933e04a9dcbc7dec18c1056c9cbe1 (patch)
tree35be0a27159e91369849f0f9a31aa2212b60b948 /gdb/testsuite
parent7c50a93137df660f7b2d9d68c0db748a9cb7868f (diff)
downloadgdb-86e4ed39595933e04a9dcbc7dec18c1056c9cbe1.zip
gdb-86e4ed39595933e04a9dcbc7dec18c1056c9cbe1.tar.gz
gdb-86e4ed39595933e04a9dcbc7dec18c1056c9cbe1.tar.bz2
New python method gdb.Objfile.add_separate_debug_file.
gdb/ChangeLog: * NEWS: Mention gdb.Objfile.add_separate_debug_file. * python/py-objfile.c (objfpy_add_separate_debug_file): New function. (objfile_getset): Add "add_separate_debug_file". gdb/doc/ChangeLog: * python.texi (Objfiles In Python): Document Objfile.add_separate_debug_file. gdb/testsuite/ChangeLog: * gdb.python/py-objfile.exp: Add tests for objfile.add_separate_debug_file.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.python/py-objfile.exp26
2 files changed, 31 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index b19a5c0..dbbcfa2 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2014-12-04 Doug Evans <dje@google.com>
+ * gdb.python/py-objfile.exp: Add tests for
+ objfile.add_separate_debug_file.
+
+2014-12-04 Doug Evans <dje@google.com>
+
* lib/gdb.exp (get_build_id): New function.
(build_id_debug_filename_get): Rewrite to use it.
* gdb.python/py-objfile.exp: Add test for objfile.build_id.
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"