• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

修订版3cb92de7426578057cc03bb3e540772d0828b151 (tree)
时间2017-02-22 06:32:50
作者Keith Seitz <keiths@redh...>
CommiterKeith Seitz

Log Message

Use struct block_symbol in linespec APIs.

This patch changes linespec's internal API functions to use block_symbol's
everywhere it currently uses
struct symbol's.

gdb/ChangeLog

更改概述

差异

--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -5861,7 +5861,7 @@ ada_iterate_over_symbols (const struct block *block,
58615861 ndefs = ada_lookup_symbol_list_worker (name, block, domain, &results, 0);
58625862 for (i = 0; i < ndefs; ++i)
58635863 {
5864- if (! (*callback) (results[i].symbol, data))
5864+ if (! (*callback) (results[i], data))
58655865 break;
58665866 }
58675867 }
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -45,9 +45,6 @@
4545 #include "stack.h"
4646 #include "location.h"
4747
48-typedef struct symbol *symbolp;
49-DEF_VEC_P (symbolp);
50-
5148 typedef struct type *typep;
5249 DEF_VEC_P (typep);
5350
@@ -82,7 +79,7 @@ struct linespec
8279
8380 /* A list of matching function symbols and minimal symbols. Both lists
8481 may be NULL if no matching symbols were found. */
85- VEC (symbolp) *function_symbols;
82+ VEC (block_symbol_d) *function_symbols;
8683 VEC (bound_minimal_symbol_d) *minimal_symbols;
8784
8885 /* A structure of matching label symbols and the corresponding
@@ -90,8 +87,8 @@ struct linespec
9087 or both must be non-NULL. */
9188 struct
9289 {
93- VEC (symbolp) *label_symbols;
94- VEC (symbolp) *function_symbols;
90+ VEC (block_symbol_d) *label_symbols;
91+ VEC (block_symbol_d) *function_symbols;
9592 } labels;
9693 };
9794 typedef struct linespec *linespec_p;
@@ -168,7 +165,7 @@ struct collect_info
168165 /* The result being accumulated. */
169166 struct
170167 {
171- VEC (symbolp) *symbols;
168+ VEC (block_symbol_d) *symbols;
172169 VEC (bound_minimal_symbol_d) *minimal_symbols;
173170 } result;
174171 };
@@ -281,15 +278,16 @@ static struct symtabs_and_lines decode_objc (struct linespec_state *self,
281278 static VEC (symtab_ptr) *symtabs_from_filename (const char *,
282279 struct program_space *pspace);
283280
284-static VEC (symbolp) *find_label_symbols (struct linespec_state *self,
285- VEC (symbolp) *function_symbols,
286- VEC (symbolp) **label_funcs_ret,
287- const char *name);
281+static VEC (block_symbol_d) *find_label_symbols
282+ (struct linespec_state *self,
283+ VEC (block_symbol_d) *function_symbols,
284+ VEC (block_symbol_d) **label_funcs_ret,
285+ const char *name);
288286
289287 static void find_linespec_symbols (struct linespec_state *self,
290288 VEC (symtab_ptr) *file_symtabs,
291289 const char *name,
292- VEC (symbolp) **symbols,
290+ VEC (block_symbol_d) **symbols,
293291 VEC (bound_minimal_symbol_d) **minsyms);
294292
295293 static struct line_offset
@@ -932,9 +930,9 @@ struct symbol_and_data_callback
932930 symbols only. */
933931
934932 static int
935-iterate_inline_only (struct symbol *sym, void *d)
933+iterate_inline_only (struct block_symbol sym, void *d)
936934 {
937- if (SYMBOL_INLINED (sym))
935+ if (SYMBOL_INLINED (sym.symbol))
938936 {
939937 struct symbol_and_data_callback *cad
940938 = (struct symbol_and_data_callback *) d;
@@ -1586,7 +1584,7 @@ linespec_parse_basic (linespec_parser *parser)
15861584 {
15871585 char *name;
15881586 linespec_token token;
1589- VEC (symbolp) *symbols, *labels;
1587+ VEC (block_symbol_d) *symbols, *labels;
15901588 VEC (bound_minimal_symbol_d) *minimal_symbols;
15911589 struct cleanup *cleanup;
15921590
@@ -1790,14 +1788,16 @@ canonicalize_linespec (struct linespec_state *state, const linespec_p ls)
17901788
17911789 if (explicit_loc->function_name == NULL)
17921790 {
1793- struct symbol *s;
1791+ struct block_symbol *s;
17941792
17951793 /* No function was specified, so add the symbol name. */
17961794 gdb_assert (ls->labels.function_symbols != NULL
1797- && (VEC_length (symbolp, ls->labels.function_symbols)
1795+ && (VEC_length (block_symbol_d,
1796+ ls->labels.function_symbols)
17981797 == 1));
1799- s = VEC_index (symbolp, ls->labels.function_symbols, 0);
1800- explicit_loc->function_name = xstrdup (SYMBOL_NATURAL_NAME (s));
1798+ s = VEC_index (block_symbol_d, ls->labels.function_symbols, 0);
1799+ explicit_loc->function_name
1800+ = xstrdup (SYMBOL_NATURAL_NAME (s->symbol));
18011801 }
18021802 }
18031803
@@ -1994,10 +1994,12 @@ convert_linespec_to_sals (struct linespec_state *state, linespec_p ls)
19941994 /* We have just a bunch of functions/methods or labels. */
19951995 int i;
19961996 struct symtab_and_line sal;
1997- struct symbol *sym;
1997+ struct block_symbol *elt;
19981998
1999- for (i = 0; VEC_iterate (symbolp, ls->labels.label_symbols, i, sym); ++i)
1999+ for (i = 0;
2000+ VEC_iterate (block_symbol_d, ls->labels.label_symbols, i, elt); ++i)
20002001 {
2002+ struct symbol *sym = elt->symbol;
20012003 struct program_space *pspace = SYMTAB_PSPACE (symbol_symtab (sym));
20022004
20032005 if (symbol_to_sal (&sal, state->funfirstline, sym)
@@ -2011,20 +2013,23 @@ convert_linespec_to_sals (struct linespec_state *state, linespec_p ls)
20112013 /* We have just a bunch of functions and/or methods. */
20122014 int i;
20132015 struct symtab_and_line sal;
2014- struct symbol *sym;
2015- bound_minimal_symbol_d *elem;
20162016 struct program_space *pspace;
20172017
20182018 if (ls->function_symbols != NULL)
20192019 {
2020+ struct block_symbol *elem;
2021+
20202022 /* Sort symbols so that symbols with the same program space are next
20212023 to each other. */
2022- qsort (VEC_address (symbolp, ls->function_symbols),
2023- VEC_length (symbolp, ls->function_symbols),
2024- sizeof (symbolp), compare_symbols);
2024+ qsort (VEC_address (block_symbol_d, ls->function_symbols),
2025+ VEC_length (block_symbol_d, ls->function_symbols),
2026+ sizeof (block_symbol_d), compare_symbols);
20252027
2026- for (i = 0; VEC_iterate (symbolp, ls->function_symbols, i, sym); ++i)
2028+ for (i = 0;
2029+ VEC_iterate (block_symbol_d, ls->function_symbols, i, elem); ++i)
20272030 {
2031+ struct symbol *sym = elem->symbol;
2032+
20282033 pspace = SYMTAB_PSPACE (symbol_symtab (sym));
20292034 set_current_program_space (pspace);
20302035 if (symbol_to_sal (&sal, state->funfirstline, sym)
@@ -2036,6 +2041,8 @@ convert_linespec_to_sals (struct linespec_state *state, linespec_p ls)
20362041
20372042 if (ls->minimal_symbols != NULL)
20382043 {
2044+ bound_minimal_symbol_d *elem;
2045+
20392046 /* Sort minimal symbols by program space, too. */
20402047 qsort (VEC_address (bound_minimal_symbol_d, ls->minimal_symbols),
20412048 VEC_length (bound_minimal_symbol_d, ls->minimal_symbols),
@@ -2090,7 +2097,8 @@ convert_explicit_location_to_sals (struct linespec_state *self,
20902097 linespec_p result,
20912098 const struct explicit_location *explicit_loc)
20922099 {
2093- VEC (symbolp) *symbols, *labels;
2100+ VEC (block_symbol_d) *labels;
2101+ VEC (block_symbol_d) *symbols;
20942102 VEC (bound_minimal_symbol_d) *minimal_symbols;
20952103
20962104 if (explicit_loc->source_filename != NULL)
@@ -2434,16 +2442,16 @@ linespec_parser_delete (void *arg)
24342442 VEC_free (symtab_ptr, PARSER_RESULT (parser)->file_symtabs);
24352443
24362444 if (PARSER_RESULT (parser)->function_symbols != NULL)
2437- VEC_free (symbolp, PARSER_RESULT (parser)->function_symbols);
2445+ VEC_free (block_symbol_d, PARSER_RESULT (parser)->function_symbols);
24382446
24392447 if (PARSER_RESULT (parser)->minimal_symbols != NULL)
24402448 VEC_free (bound_minimal_symbol_d, PARSER_RESULT (parser)->minimal_symbols);
24412449
24422450 if (PARSER_RESULT (parser)->labels.label_symbols != NULL)
2443- VEC_free (symbolp, PARSER_RESULT (parser)->labels.label_symbols);
2451+ VEC_free (block_symbol_d, PARSER_RESULT (parser)->labels.label_symbols);
24442452
24452453 if (PARSER_RESULT (parser)->labels.function_symbols != NULL)
2446- VEC_free (symbolp, PARSER_RESULT (parser)->labels.function_symbols);
2454+ VEC_free (block_symbol_d, PARSER_RESULT (parser)->labels.function_symbols);
24472455
24482456 linespec_state_destructor (PARSER_STATE (parser));
24492457 }
@@ -2786,7 +2794,7 @@ decode_objc (struct linespec_state *self, linespec_p ls, const char *arg)
27862794
27872795 add_all_symbol_names_from_pspace (&info, NULL, symbol_names);
27882796
2789- if (!VEC_empty (symbolp, info.result.symbols)
2797+ if (!VEC_empty (block_symbol_d, info.result.symbols)
27902798 || !VEC_empty (bound_minimal_symbol_d, info.result.minimal_symbols))
27912799 {
27922800 char *saved_arg;
@@ -2830,7 +2838,7 @@ decode_objc (struct linespec_state *self, linespec_p ls, const char *arg)
28302838 struct decode_compound_collector
28312839 {
28322840 /* The result vector. */
2833- VEC (symbolp) *symbols;
2841+ VEC (block_symbol_d) *symbols;
28342842
28352843 /* A hash table of all symbols we found. We use this to avoid
28362844 adding any symbol more than once. */
@@ -2853,12 +2861,13 @@ struct decode_compound_collector
28532861 lookup_prefix_sym to collect type symbols. */
28542862
28552863 static int
2856-collect_one_symbol (struct symbol *sym, void *d)
2864+collect_one_symbol (struct block_symbol block_sym, void *d)
28572865 {
28582866 struct decode_compound_collector *collector
28592867 = (struct decode_compound_collector *) d;
28602868 void **slot;
28612869 struct type *t;
2870+ struct symbol *sym = block_sym.symbol;
28622871
28632872 if (SYMBOL_CLASS (sym) != LOC_TYPEDEF)
28642873 return 1; /* Continue iterating. */
@@ -2874,7 +2883,7 @@ collect_one_symbol (struct symbol *sym, void *d)
28742883 if (!*slot)
28752884 {
28762885 *slot = sym;
2877- VEC_safe_push (symbolp, collector->symbols, sym);
2886+ VEC_safe_push (block_symbol_d, collector->symbols, &block_sym);
28782887 }
28792888
28802889 return 1; /* Continue iterating. */
@@ -2882,7 +2891,7 @@ collect_one_symbol (struct symbol *sym, void *d)
28822891
28832892 /* Return any symbols corresponding to CLASS_NAME in FILE_SYMTABS. */
28842893
2885-static VEC (symbolp) *
2894+static VEC (block_symbol_d) *
28862895 lookup_prefix_sym (struct linespec_state *state, VEC (symtab_ptr) *file_symtabs,
28872896 const char *class_name)
28882897 {
@@ -2893,7 +2902,7 @@ lookup_prefix_sym (struct linespec_state *state, VEC (symtab_ptr) *file_symtabs,
28932902 struct cleanup *cleanup;
28942903
28952904 collector.symbols = NULL;
2896- outer = make_cleanup (VEC_cleanup (symbolp), &collector.symbols);
2905+ outer = make_cleanup (VEC_cleanup (block_symbol_d), &collector.symbols);
28972906
28982907 collector.unique_syms = htab_create_alloc (1, htab_hash_pointer,
28992908 htab_eq_pointer, NULL,
@@ -2934,20 +2943,22 @@ lookup_prefix_sym (struct linespec_state *state, VEC (symtab_ptr) *file_symtabs,
29342943 static int
29352944 compare_symbols (const void *a, const void *b)
29362945 {
2937- struct symbol * const *sa = (struct symbol * const*) a;
2938- struct symbol * const *sb = (struct symbol * const*) b;
2946+ const struct block_symbol *ba = (const struct block_symbol *) a;
2947+ const struct block_symbol *bb = (const struct block_symbol *) b;
2948+ const struct symbol *sa = ba->symbol;
2949+ const struct symbol *sb = bb->symbol;
29392950 uintptr_t uia, uib;
29402951
2941- uia = (uintptr_t) SYMTAB_PSPACE (symbol_symtab (*sa));
2942- uib = (uintptr_t) SYMTAB_PSPACE (symbol_symtab (*sb));
2952+ uia = (uintptr_t) SYMTAB_PSPACE (symbol_symtab (sa));
2953+ uib = (uintptr_t) SYMTAB_PSPACE (symbol_symtab (sb));
29432954
29442955 if (uia < uib)
29452956 return -1;
29462957 if (uia > uib)
29472958 return 1;
29482959
2949- uia = (uintptr_t) *sa;
2950- uib = (uintptr_t) *sb;
2960+ uia = (uintptr_t) sa;
2961+ uib = (uintptr_t) sb;
29512962
29522963 if (uia < uib)
29532964 return -1;
@@ -3041,10 +3052,10 @@ find_superclass_methods (VEC (typep) *superclasses,
30413052 static void
30423053 find_method (struct linespec_state *self, VEC (symtab_ptr) *file_symtabs,
30433054 const char *class_name, const char *method_name,
3044- VEC (symbolp) *sym_classes, VEC (symbolp) **symbols,
3055+ VEC (block_symbol_d) *sym_classes, VEC (block_symbol_d) **symbols,
30453056 VEC (bound_minimal_symbol_d) **minsyms)
30463057 {
3047- struct symbol *sym;
3058+ struct block_symbol *elt;
30483059 struct cleanup *cleanup = make_cleanup (null_cleanup, NULL);
30493060 int ix;
30503061 int last_result_len;
@@ -3054,9 +3065,9 @@ find_method (struct linespec_state *self, VEC (symtab_ptr) *file_symtabs,
30543065
30553066 /* Sort symbols so that symbols with the same program space are next
30563067 to each other. */
3057- qsort (VEC_address (symbolp, sym_classes),
3058- VEC_length (symbolp, sym_classes),
3059- sizeof (symbolp),
3068+ qsort (VEC_address (block_symbol_d, sym_classes),
3069+ VEC_length (block_symbol_d, sym_classes),
3070+ sizeof (block_symbol_d),
30603071 compare_symbols);
30613072
30623073 info.state = self;
@@ -3078,10 +3089,11 @@ find_method (struct linespec_state *self, VEC (symtab_ptr) *file_symtabs,
30783089 result_names = NULL;
30793090 make_cleanup (VEC_cleanup (const_char_ptr), &result_names);
30803091 last_result_len = 0;
3081- for (ix = 0; VEC_iterate (symbolp, sym_classes, ix, sym); ++ix)
3092+ for (ix = 0; VEC_iterate (block_symbol_d, sym_classes, ix, elt); ++ix)
30823093 {
30833094 struct type *t;
30843095 struct program_space *pspace;
3096+ struct symbol *sym = elt->symbol;
30853097
30863098 /* Program spaces that are executing startup should have
30873099 been filtered out earlier. */
@@ -3093,10 +3105,11 @@ find_method (struct linespec_state *self, VEC (symtab_ptr) *file_symtabs,
30933105
30943106 /* Handle all items from a single program space at once; and be
30953107 sure not to miss the last batch. */
3096- if (ix == VEC_length (symbolp, sym_classes) - 1
3108+ if (ix == VEC_length (block_symbol_d, sym_classes) - 1
30973109 || (pspace
3098- != SYMTAB_PSPACE (symbol_symtab (VEC_index (symbolp, sym_classes,
3099- ix + 1)))))
3110+ != SYMTAB_PSPACE (symbol_symtab (VEC_index (block_symbol_d,
3111+ sym_classes,
3112+ ix + 1)->symbol))))
31003113 {
31013114 /* If we did not find a direct implementation anywhere in
31023115 this program space, consider superclasses. */
@@ -3114,7 +3127,7 @@ find_method (struct linespec_state *self, VEC (symtab_ptr) *file_symtabs,
31143127 }
31153128 }
31163129
3117- if (!VEC_empty (symbolp, info.result.symbols)
3130+ if (!VEC_empty (block_symbol_d, info.result.symbols)
31183131 || !VEC_empty (bound_minimal_symbol_d, info.result.minimal_symbols))
31193132 {
31203133 *symbols = info.result.symbols;
@@ -3238,7 +3251,7 @@ symtabs_from_filename (const char *filename,
32383251 static void
32393252 find_function_symbols (struct linespec_state *state,
32403253 VEC (symtab_ptr) *file_symtabs, const char *name,
3241- VEC (symbolp) **symbols,
3254+ VEC (block_symbol_d) **symbols,
32423255 VEC (bound_minimal_symbol_d) **minsyms)
32433256 {
32443257 struct collect_info info;
@@ -3261,9 +3274,9 @@ find_function_symbols (struct linespec_state *state,
32613274
32623275 do_cleanups (cleanup);
32633276
3264- if (VEC_empty (symbolp, info.result.symbols))
3277+ if (VEC_empty (block_symbol_d, info.result.symbols))
32653278 {
3266- VEC_free (symbolp, info.result.symbols);
3279+ VEC_free (block_symbol_d, info.result.symbols);
32673280 *symbols = NULL;
32683281 }
32693282 else
@@ -3285,7 +3298,7 @@ static void
32853298 find_linespec_symbols (struct linespec_state *state,
32863299 VEC (symtab_ptr) *file_symtabs,
32873300 const char *name,
3288- VEC (symbolp) **symbols,
3301+ VEC (block_symbol_d) **symbols,
32893302 VEC (bound_minimal_symbol_d) **minsyms)
32903303 {
32913304 demangle_result_storage demangle_storage;
@@ -3325,12 +3338,12 @@ find_linespec_symbols (struct linespec_state *state,
33253338 /* If we were unable to locate a symbol of the same name, try dividing
33263339 the name into class and method names and searching the class and its
33273340 baseclasses. */
3328- if (VEC_empty (symbolp, *symbols)
3341+ if (VEC_empty (block_symbol_d, *symbols)
33293342 && VEC_empty (bound_minimal_symbol_d, *minsyms))
33303343 {
33313344 std::string klass, method;
33323345 const char *last, *p, *scope_op;
3333- VEC (symbolp) *classes;
3346+ VEC (block_symbol_d) *classes;
33343347
33353348 /* See if we can find a scope operator and break this symbol
33363349 name into namespaces${SCOPE_OPERATOR}class_name and method_name. */
@@ -3361,9 +3374,9 @@ find_linespec_symbols (struct linespec_state *state,
33613374 /* Find a list of classes named KLASS. */
33623375 classes = lookup_prefix_sym (state, file_symtabs, klass.c_str ());
33633376 struct cleanup *old_chain
3364- = make_cleanup (VEC_cleanup (symbolp), &classes);
3377+ = make_cleanup (VEC_cleanup (block_symbol_d), &classes);
33653378
3366- if (!VEC_empty (symbolp, classes))
3379+ if (!VEC_empty (block_symbol_d, classes))
33673380 {
33683381 /* Now locate a list of suitable methods named METHOD. */
33693382 TRY
@@ -3390,19 +3403,21 @@ find_linespec_symbols (struct linespec_state *state,
33903403 /* Return all labels named NAME in FUNCTION_SYMBOLS. Return the
33913404 actual function symbol in which the label was found in LABEL_FUNC_RET. */
33923405
3393-static VEC (symbolp) *
3406+static VEC (block_symbol_d) *
33943407 find_label_symbols (struct linespec_state *self,
3395- VEC (symbolp) *function_symbols,
3396- VEC (symbolp) **label_funcs_ret, const char *name)
3408+ VEC (block_symbol_d) *function_symbols,
3409+ VEC (block_symbol_d) **label_funcs_ret, const char *name)
33973410 {
33983411 int ix;
33993412 const struct block *block;
3400- struct symbol *sym;
3401- struct symbol *fn_sym;
3402- VEC (symbolp) *result = NULL;
3413+
3414+ VEC (block_symbol_d) *result = NULL;
34033415
34043416 if (function_symbols == NULL)
34053417 {
3418+ struct block_symbol block_sym;
3419+ struct block_symbol fn_block_sym;
3420+
34063421 set_current_program_space (self->program_space);
34073422 block = get_current_search_block ();
34083423
@@ -3412,29 +3427,35 @@ find_label_symbols (struct linespec_state *self,
34123427 ;
34133428 if (!block)
34143429 return NULL;
3415- fn_sym = BLOCK_FUNCTION (block);
3430+ fn_block_sym.symbol = BLOCK_FUNCTION (block);
3431+ fn_block_sym.block = block;
34163432
3417- sym = lookup_symbol (name, block, LABEL_DOMAIN, 0).symbol;
3433+ block_sym = lookup_symbol (name, block, LABEL_DOMAIN, 0);
34183434
3419- if (sym != NULL)
3435+ if (block_sym.symbol != NULL)
34203436 {
3421- VEC_safe_push (symbolp, result, sym);
3422- VEC_safe_push (symbolp, *label_funcs_ret, fn_sym);
3437+ VEC_safe_push (block_symbol_d, result, &block_sym);
3438+ VEC_safe_push (block_symbol_d, *label_funcs_ret, &fn_block_sym);
34233439 }
34243440 }
34253441 else
34263442 {
3443+ struct block_symbol *elt;
3444+
34273445 for (ix = 0;
3428- VEC_iterate (symbolp, function_symbols, ix, fn_sym); ++ix)
3446+ VEC_iterate (block_symbol_d, function_symbols, ix, elt); ++ix)
34293447 {
3448+ struct symbol *fn_sym = elt->symbol;
3449+ struct block_symbol block_sym;
3450+
34303451 set_current_program_space (SYMTAB_PSPACE (symbol_symtab (fn_sym)));
34313452 block = SYMBOL_BLOCK_VALUE (fn_sym);
3432- sym = lookup_symbol (name, block, LABEL_DOMAIN, 0).symbol;
3453+ block_sym = lookup_symbol (name, block, LABEL_DOMAIN, 0);
34333454
3434- if (sym != NULL)
3455+ if (block_sym.symbol != NULL)
34353456 {
3436- VEC_safe_push (symbolp, result, sym);
3437- VEC_safe_push (symbolp, *label_funcs_ret, fn_sym);
3457+ VEC_safe_push (block_symbol_d, result, &block_sym);
3458+ VEC_safe_push (block_symbol_d, *label_funcs_ret, elt);
34383459 }
34393460 }
34403461 }
@@ -3580,14 +3601,14 @@ linespec_parse_variable (struct linespec_state *self, const char *variable)
35803601 /* A callback used to possibly add a symbol to the results. */
35813602
35823603 static int
3583-collect_symbols (struct symbol *sym, void *data)
3604+collect_symbols (struct block_symbol sym, void *data)
35843605 {
35853606 struct collect_info *info = (struct collect_info *) data;
35863607
35873608 /* In list mode, add all matching symbols, regardless of class.
35883609 This allows the user to type "list a_global_variable". */
3589- if (SYMBOL_CLASS (sym) == LOC_BLOCK || info->state->list_mode)
3590- VEC_safe_push (symbolp, info->result.symbols, sym);
3610+ if (SYMBOL_CLASS (sym.symbol) == LOC_BLOCK || info->state->list_mode)
3611+ VEC_safe_push (block_symbol_d, info->result.symbols, &sym);
35913612 return 1; /* Continue iterating. */
35923613 }
35933614
@@ -3864,7 +3885,7 @@ add_matching_symbols_to_info (const char *name,
38643885 }
38653886 else if (pspace == NULL || pspace == SYMTAB_PSPACE (elt))
38663887 {
3867- int prev_len = VEC_length (symbolp, info->result.symbols);
3888+ int prev_len = VEC_length (block_symbol_d, info->result.symbols);
38683889
38693890 /* Program spaces that are executing startup should have
38703891 been filtered out earlier. */
@@ -3877,7 +3898,7 @@ add_matching_symbols_to_info (const char *name,
38773898 is in assembler, we might actually be looking for a label for
38783899 which we don't have debug info. Check for a minimal symbol in
38793900 this case. */
3880- if (prev_len == VEC_length (symbolp, info->result.symbols)
3901+ if (prev_len == VEC_length (block_symbol_d, info->result.symbols)
38813902 && elt->language == language_asm)
38823903 search_minsyms_for_name (info, name, pspace, elt);
38833904 }
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -2798,7 +2798,9 @@ iterate_over_symbols (const struct block *block, const char *name,
27982798 if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
27992799 SYMBOL_DOMAIN (sym), domain))
28002800 {
2801- if (!callback (sym, data))
2801+ struct block_symbol block_sym = {sym, block};
2802+
2803+ if (!callback (block_sym, data))
28022804 return;
28032805 }
28042806 }
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -834,6 +834,9 @@ struct block_symbol
834834 const struct block *block;
835835 };
836836
837+typedef struct block_symbol block_symbol_d;
838+DEF_VEC_O (block_symbol_d);
839+
837840 extern const struct symbol_impl *symbol_impls;
838841
839842 /* For convenience. All fields are NULL. This means "there is no
@@ -1630,7 +1633,7 @@ VEC (CORE_ADDR) *find_pcs_for_symtab_line (struct symtab *symtab, int line,
16301633 should continue iterating, or zero to indicate that the iteration
16311634 should end. */
16321635
1633-typedef int (symbol_found_callback_ftype) (struct symbol *sym, void *data);
1636+typedef int (symbol_found_callback_ftype) (struct block_symbol sym, void *data);
16341637
16351638 void iterate_over_symbols (const struct block *block, const char *name,
16361639 const domain_enum domain,