From 0bfa869d53ae28e6707936910a55317dfe816e14 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Tue, 10 Jul 2012 20:12:49 +0000 Subject: * dictionary.c (dict_add_pending): New function. * dictionary.h (dict_add_pending): Declare. --- gdb/ChangeLog | 5 +++++ gdb/dictionary.c | 16 ++++++++++++++++ gdb/dictionary.h | 5 +++++ 3 files changed, 26 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c866c5b..ea490d9 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2012-07-10 Doug Evans + + * dictionary.c (dict_add_pending): New function. + * dictionary.h (dict_add_pending): Declare. + 2012-07-09 Doug Evans * buildsym.c (start_subfile): Remove unnecessary check for diff --git a/gdb/dictionary.c b/gdb/dictionary.c index 0a3a103..62362c5 100644 --- a/gdb/dictionary.c +++ b/gdb/dictionary.c @@ -498,6 +498,22 @@ dict_add_symbol (struct dictionary *dict, struct symbol *sym) (DICT_VECTOR (dict))->add_symbol (dict, sym); } +/* Utility to add a list of symbols to a dictionary. + DICT must be an expandable dictionary. */ + +void +dict_add_pending (struct dictionary *dict, const struct pending *symbol_list) +{ + const struct pending *list; + int i; + + for (list = symbol_list; list != NULL; list = list->next) + { + for (i = 0; i < list->nsyms; ++i) + dict_add_symbol (dict, list->symbol[i]); + } +} + /* Initialize ITERATOR to point at the first symbol in DICT, and return that first symbol, or NULL if DICT is empty. */ diff --git a/gdb/dictionary.h b/gdb/dictionary.h index 1d58fab..1f012f3 100644 --- a/gdb/dictionary.h +++ b/gdb/dictionary.h @@ -85,6 +85,11 @@ extern void dict_free (struct dictionary *dict); extern void dict_add_symbol (struct dictionary *dict, struct symbol *sym); +/* Utility to add a list of symbols to a dictionary. */ + +extern void dict_add_pending (struct dictionary *dict, + const struct pending *symbol_list); + /* Is the dictionary empty? */ extern int dict_empty (struct dictionary *dict); -- cgit v1.1