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/objfiles.h | |
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/objfiles.h')
-rw-r--r-- | gdb/objfiles.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/objfiles.h b/gdb/objfiles.h index 8782797..a0dc69b 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -699,8 +699,17 @@ extern void default_iterate_over_objfiles_in_search_order void set_objfile_per_bfd (struct objfile *obj); +/* Return canonical name for OBJFILE. + This is the real file name if the file has been opened. + Otherwise it is the original name supplied by the user. */ + const char *objfile_name (const struct objfile *objfile); +/* Return the (real) file name of OBJFILE if the file has been opened, + otherwise return NULL. */ + +const char *objfile_filename (const struct objfile *objfile); + /* Return the name to print for OBJFILE in debugging messages. */ extern const char *objfile_debug_name (const struct objfile *objfile); |