From 5ff888ce0e5a14dbf1efea30befca5013e54e0af Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Wed, 3 Apr 2013 18:48:54 +0000 Subject: [PATCH] * psymtab.c (read_psymtabs_with_fullname): Don't call psymtab_to_fullname if the basenames are different. --- gdb/ChangeLog | 5 +++++ gdb/psymtab.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6db6cdf6a40..ad754fc52a4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2013-04-03 Doug Evans + + * psymtab.c (read_psymtabs_with_fullname): Don't call + psymtab_to_fullname if the basenames are different. + 2013-04-03 Jan Kratochvil * NEWS (Changes in GDB 7.6): Update the data-disassemble for "fullname". diff --git a/gdb/psymtab.c b/gdb/psymtab.c index de8a3ccd736..1d5f0ee42d9 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -1114,7 +1114,11 @@ read_psymtabs_with_fullname (struct objfile *objfile, const char *fullname) if (p->anonymous) continue; - if (filename_cmp (fullname, psymtab_to_fullname (p)) == 0) + /* psymtab_to_fullname tries to open the file which is slow. + Don't call it if we know the basenames don't match. */ + if ((basenames_may_differ + || filename_cmp (lbasename (fullname), lbasename (p->filename)) == 0) + && filename_cmp (fullname, psymtab_to_fullname (p)) == 0) psymtab_to_symtab (objfile, p); } } -- 2.30.2