aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2013-10-02 09:22:32 +0000
committerJoel Brobecker <brobecker@gnat.com>2013-10-02 09:22:32 +0000
commit6b9780fbbd65d5a1cf56a15552c50bd6bfa10a10 (patch)
tree2096e52b7437446d47d3ec90383e3aa36aa7655d /gdb
parent751e7549b07aef34e4657e8e9cb86ec9ae4656b1 (diff)
downloadgdb-6b9780fbbd65d5a1cf56a15552c50bd6bfa10a10.zip
gdb-6b9780fbbd65d5a1cf56a15552c50bd6bfa10a10.tar.gz
gdb-6b9780fbbd65d5a1cf56a15552c50bd6bfa10a10.tar.bz2
Delete search_symbols_equal (use compare_search_syms instead).
This avoids duplicating the logic comparing two symbol_search objects (in search_symbols_equal and compare_search_syms). gdb/ChangeLog: * symtab.c (search_symbols_equal): Delete. (sort_search_symbols_remove_dups): Replace call to search_symbols_equal by call to compare_search_syms, adjusting as necessary.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/symtab.c15
2 files changed, 8 insertions, 14 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c399655..84e8cc5 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2013-10-02 Joel Brobecker <brobecker@adacore.com>
+
+ * symtab.c (search_symbols_equal): Delete.
+ (sort_search_symbols_remove_dups): Replace call to
+ search_symbols_equal by call to compare_search_syms,
+ adjusting as necessary.
+
2013-10-02 Phil Muldoon <pmuldoon@redhat.com>
PR python/15579
diff --git a/gdb/symtab.c b/gdb/symtab.c
index dbff042..cf03b43 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -3347,19 +3347,6 @@ compare_search_syms (const void *sa, const void *sb)
SYMBOL_PRINT_NAME (sym_b->symbol));
}
-/* Helper function for sort_search_symbols_remove_dups.
- Return TRUE if symbols A, B are equal. */
-
-static int
-search_symbols_equal (const struct symbol_search *a,
- const struct symbol_search *b)
-{
- return (strcmp (a->symtab->filename, b->symtab->filename) == 0
- && a->block == b->block
- && strcmp (SYMBOL_PRINT_NAME (a->symbol),
- SYMBOL_PRINT_NAME (b->symbol)) == 0);
-}
-
/* Sort the NFOUND symbols in list FOUND and remove duplicates.
The duplicates are freed, and the new list is returned in
*NEW_HEAD, *NEW_TAIL. */
@@ -3393,7 +3380,7 @@ sort_search_symbols_remove_dups (struct symbol_search *found, int nfound,
/* Collapse out the dups. */
for (i = 1, j = 1; i < nfound; ++i)
{
- if (! search_symbols_equal (symbols[j - 1], symbols[i]))
+ if (compare_search_syms (&symbols[j - 1], &symbols[i]) != 0)
symbols[j++] = symbols[i];
else
xfree (symbols[i]);