mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-17 07:53:51 +08:00
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.
This commit is contained in:
@ -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"
|
||||
|
Reference in New Issue
Block a user