mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-20 01:50:24 +08:00
Enhance gdb.lookup_objfile so that it works with a symlinked binary.
gdb/Changelog: * objfiles.c (objfile_filename): New function. * objfiles.h (objfile_filename): Declare it. (objfile_name): Add function comment. * python/py-objfile.c (objfpy_lookup_objfile_by_name): Try both the bfd file name (which may be realpath'd), and the original name. gdb/testsuite/ChangeLog: * gdb.python/py-objfile.exp: Test gdb.lookup_objfile on symlinked binary.
This commit is contained in:
@ -115,3 +115,14 @@ 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}"
|
||||
}
|
||||
|
||||
# An objfile that was a symlink to a differently named file is still
|
||||
# findable with its original name.
|
||||
set symlink_binary [standard_output_file "symlink-binary"]
|
||||
remote_exec host "rm -f ${symlink_binary}"
|
||||
remote_exec host "ln -sf ${testfile} ${symlink_binary}"
|
||||
if [remote_file host exists "${symlink_binary}"] {
|
||||
clean_restart "${symlink_binary}"
|
||||
gdb_test "python print (gdb.lookup_objfile (\"${symlink_binary}\").filename)" \
|
||||
"${testfile}" "gdb.lookup_objfile of symlinked binary"
|
||||
}
|
||||
|
Reference in New Issue
Block a user