"Get objfile user name"
gdb_test "python print (gdb.lookup_objfile (\"${testfile}\").filename)" \
- "${testfile}"
+ "${testfile}" "print lookup_objfile filename"
gdb_test "python print (gdb.lookup_objfile (\"junk\"))" \
"Objfile not found\\.\r\n${python_error_text}"
gdb_test "python print (objfile.build_id)" "$binfile_build_id" \
"Get objfile build id"
gdb_test "python print (gdb.lookup_objfile (\"$binfile_build_id\", by_build_id=True).filename)" \
- "${testfile}"
+ "${testfile}" "print lookup_objfile filename by build-id"
} else {
unsupported "build-id is not supported by the compiler"
}
# Other lookup_objfile_by_build_id tests we can do, even if compiler doesn't
# support them.
gdb_test "python print (gdb.lookup_objfile (\"foo\", by_build_id=True))" \
- "Not a valid build id\\.\r\n${python_error_text}"
+ "Not a valid build id\\.\r\n${python_error_text}" \
+ "print invalid file lookup_objfile by build-id"
gdb_test "python print (gdb.lookup_objfile (\"1234abcdef\", by_build_id=True))" \
- "Objfile not found\\.\r\n${python_error_text}"
+ "Objfile not found\\.\r\n${python_error_text}" \
+ "print invalid file lookup_objfile by build-id 2"
gdb_test "python print (objfile.progspace)" "<gdb\.Progspace object at .*>" \
"Get objfile program space"
return 0
}
-gdb_py_test_silent_cmd "python objfile = gdb.objfiles()\[0\]" \
+gdb_py_test_silent_cmd "python objfile = gdb.s()\[0\]" \
"Get no-debug objfile file" 1
gdb_test "python print (objfile.owner)" "None" \
# Separate debug files are not findable.
if { [get_python_valueof "sep_objfile.build_id" "None"] != "None" } {
gdb_test "python print (gdb.lookup_objfile (sep_objfile.build_id, by_build_id=True))" \
- "Objfile not found\\.\r\n${python_error_text}"
+ "Objfile not found\\.\r\n${python_error_text}" \
+ "print lookup_objfile of separate debug file"
}
# An objfile that was a symlink to a differently named file is still
return 0
}
- gdb_test_no_output "python exec (open ('${remote_python_file}').read ())"
+ gdb_test_no_output "python exec (open ('${remote_python_file}').read ())" \
+ "read file"
gdb_test_no_output "py progspace = gdb.current_progspace()"
gdb_test_no_output "py my_pretty_printer1 = build_pretty_printer1()"
gdb_test "py gdb.printing.register_pretty_printer(progspace, my_pretty_printer2, replace=False)" \
"RuntimeError: pretty-printer already registered: pp-test\r\nError while executing Python code."
- test_printers "s1"
+ with_test_prefix "test printers 1" {
+ test_printers "s1"
+ }
gdb_test_no_output "py gdb.printing.register_pretty_printer(progspace, my_pretty_printer2, replace=True)"
- test_printers "s2"
+ with_test_prefix "test printers 2" {
+ test_printers "s2"
+ }
}