From 74dd2ca6a705dd8239f13b173b2f3ddd9f0b14af Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Tue, 7 Dec 2010 17:30:52 +0000 Subject: [PATCH] * dwarf2read.c (dw2_lookup_symtab): Remove duplicate call to gdb_realpath. --- gdb/ChangeLog | 3 +++ gdb/dwarf2read.c | 13 ++++--------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 324b153a563..6611a84dc04 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,8 @@ 2010-12-07 Doug Evans + * dwarf2read.c (dw2_lookup_symtab): Remove duplicate call to + gdb_realpath. + PR python/12227 * NEWS: Mention -data-directory. * main.c (captured_main): Recognize -data-directory. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 31a08a74e82..1cc5258a565 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -2199,16 +2199,11 @@ dw2_lookup_symtab (struct objfile *objfile, const char *name, const char *this_full_name = dw2_require_full_path (objfile, per_cu, j); - if (this_full_name != NULL) + if (this_full_name != NULL + && FILENAME_CMP (real_path, this_full_name) == 0) { - char *rp = gdb_realpath (this_full_name); - if (rp != NULL && FILENAME_CMP (real_path, rp) == 0) - { - xfree (rp); - *result = dw2_instantiate_symtab (objfile, per_cu); - return 1; - } - xfree (rp); + *result = dw2_instantiate_symtab (objfile, per_cu); + return 1; } } } -- 2.30.2