diff options
author | Doug Evans <dje@google.com> | 2015-01-13 17:00:31 -0800 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2015-01-13 17:02:53 -0800 |
commit | e02c96a79949824bbe1da22ddfc6b50d362fb552 (patch) | |
tree | 8703c754cef937d9fd90c9224327bc81f729f9fa /gdb/python | |
parent | 8068939ab8058b48d0c7c318d463b0c6b85741fa (diff) | |
download | gdb-e02c96a79949824bbe1da22ddfc6b50d362fb552.zip gdb-e02c96a79949824bbe1da22ddfc6b50d362fb552.tar.gz gdb-e02c96a79949824bbe1da22ddfc6b50d362fb552.tar.bz2 |
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.
Diffstat (limited to 'gdb/python')
-rw-r--r-- | gdb/python/py-objfile.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c index bdc483a..378db58 100644 --- a/gdb/python/py-objfile.c +++ b/gdb/python/py-objfile.c @@ -438,12 +438,18 @@ objfpy_lookup_objfile_by_name (const char *name) ALL_OBJFILES (objfile) { + const char *filename; + if ((objfile->flags & OBJF_NOT_FILENAME) != 0) continue; /* Don't return separate debug files. */ if (objfile->separate_debug_objfile_backlink != NULL) continue; - if (compare_filenames_for_search (objfile_name (objfile), name)) + + filename = objfile_filename (objfile); + if (filename != NULL && compare_filenames_for_search (filename, name)) + return objfile; + if (compare_filenames_for_search (objfile->original_name, name)) return objfile; } |