[AArch64] Fix mis-detection of unpredictable load/store operations with FP regs.
[deliverable/binutils-gdb.git] / gdb / block.c
CommitLineData
fe898f56
DC
1/* Block-related functions for the GNU debugger, GDB.
2
ecd75fc8 3 Copyright (C) 2003-2014 Free Software Foundation, Inc.
fe898f56
DC
4
5 This file is part of GDB.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
a9762ec7 9 the Free Software Foundation; either version 3 of the License, or
fe898f56
DC
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
a9762ec7 18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
fe898f56
DC
19
20#include "defs.h"
21#include "block.h"
22#include "symtab.h"
23#include "symfile.h"
9219021c
DC
24#include "gdb_obstack.h"
25#include "cp-support.h"
801e3a5b 26#include "addrmap.h"
8e3b41a9 27#include "gdbtypes.h"
9219021c
DC
28
29/* This is used by struct block to store namespace-related info for
30 C++ files, namely using declarations and the current namespace in
31 scope. */
32
33struct block_namespace_info
34{
35 const char *scope;
36 struct using_direct *using;
37};
38
39static void block_initialize_namespace (struct block *block,
40 struct obstack *obstack);
fe898f56
DC
41
42/* Return Nonzero if block a is lexically nested within block b,
43 or if a and b have the same pc range.
4a64f543 44 Return zero otherwise. */
fe898f56
DC
45
46int
0cf566ec 47contained_in (const struct block *a, const struct block *b)
fe898f56
DC
48{
49 if (!a || !b)
50 return 0;
edb3359d
DJ
51
52 do
53 {
54 if (a == b)
55 return 1;
49e794ac
JB
56 /* If A is a function block, then A cannot be contained in B,
57 except if A was inlined. */
58 if (BLOCK_FUNCTION (a) != NULL && !block_inlined_p (a))
59 return 0;
edb3359d
DJ
60 a = BLOCK_SUPERBLOCK (a);
61 }
62 while (a != NULL);
63
64 return 0;
fe898f56
DC
65}
66
67
68/* Return the symbol for the function which contains a specified
7f0df278
DJ
69 lexical block, described by a struct block BL. The return value
70 will not be an inlined function; the containing function will be
71 returned instead. */
fe898f56
DC
72
73struct symbol *
7f0df278 74block_linkage_function (const struct block *bl)
fe898f56 75{
edb3359d
DJ
76 while ((BLOCK_FUNCTION (bl) == NULL || block_inlined_p (bl))
77 && BLOCK_SUPERBLOCK (bl) != NULL)
fe898f56
DC
78 bl = BLOCK_SUPERBLOCK (bl);
79
80 return BLOCK_FUNCTION (bl);
81}
82
f8eba3c6
TT
83/* Return the symbol for the function which contains a specified
84 block, described by a struct block BL. The return value will be
85 the closest enclosing function, which might be an inline
86 function. */
87
88struct symbol *
89block_containing_function (const struct block *bl)
90{
91 while (BLOCK_FUNCTION (bl) == NULL && BLOCK_SUPERBLOCK (bl) != NULL)
92 bl = BLOCK_SUPERBLOCK (bl);
93
94 return BLOCK_FUNCTION (bl);
95}
96
edb3359d
DJ
97/* Return one if BL represents an inlined function. */
98
99int
100block_inlined_p (const struct block *bl)
101{
102 return BLOCK_FUNCTION (bl) != NULL && SYMBOL_INLINED (BLOCK_FUNCTION (bl));
103}
104
9703b513
TT
105/* A helper function that checks whether PC is in the blockvector BL.
106 It returns the containing block if there is one, or else NULL. */
fe898f56 107
9703b513 108static struct block *
346d1dfe 109find_block_in_blockvector (const struct blockvector *bl, CORE_ADDR pc)
fe898f56 110{
b59661bd
AC
111 struct block *b;
112 int bot, top, half;
fe898f56 113
801e3a5b
JB
114 /* If we have an addrmap mapping code addresses to blocks, then use
115 that. */
116 if (BLOCKVECTOR_MAP (bl))
9703b513 117 return addrmap_find (BLOCKVECTOR_MAP (bl), pc);
801e3a5b
JB
118
119 /* Otherwise, use binary search to find the last block that starts
6ac9ef80
DE
120 before PC.
121 Note: GLOBAL_BLOCK is block 0, STATIC_BLOCK is block 1.
122 They both have the same START,END values.
123 Historically this code would choose STATIC_BLOCK over GLOBAL_BLOCK but the
124 fact that this choice was made was subtle, now we make it explicit. */
125 gdb_assert (BLOCKVECTOR_NBLOCKS (bl) >= 2);
126 bot = STATIC_BLOCK;
fe898f56
DC
127 top = BLOCKVECTOR_NBLOCKS (bl);
128
129 while (top - bot > 1)
130 {
131 half = (top - bot + 1) >> 1;
132 b = BLOCKVECTOR_BLOCK (bl, bot + half);
133 if (BLOCK_START (b) <= pc)
134 bot += half;
135 else
136 top = bot + half;
137 }
138
139 /* Now search backward for a block that ends after PC. */
140
6ac9ef80 141 while (bot >= STATIC_BLOCK)
fe898f56
DC
142 {
143 b = BLOCKVECTOR_BLOCK (bl, bot);
144 if (BLOCK_END (b) > pc)
9703b513 145 return b;
fe898f56
DC
146 bot--;
147 }
9703b513
TT
148
149 return NULL;
150}
151
152/* Return the blockvector immediately containing the innermost lexical
153 block containing the specified pc value and section, or 0 if there
154 is none. PBLOCK is a pointer to the block. If PBLOCK is NULL, we
155 don't pass this information back to the caller. */
156
346d1dfe 157const struct blockvector *
9703b513 158blockvector_for_pc_sect (CORE_ADDR pc, struct obj_section *section,
3977b71f 159 const struct block **pblock, struct symtab *symtab)
9703b513 160{
346d1dfe 161 const struct blockvector *bl;
9703b513
TT
162 struct block *b;
163
164 if (symtab == 0) /* if no symtab specified by caller */
165 {
166 /* First search all symtabs for one whose file contains our pc */
167 symtab = find_pc_sect_symtab (pc, section);
168 if (symtab == 0)
169 return 0;
170 }
171
439247b6 172 bl = SYMTAB_BLOCKVECTOR (symtab);
9703b513
TT
173
174 /* Then search that symtab for the smallest block that wins. */
175 b = find_block_in_blockvector (bl, pc);
176 if (b == NULL)
177 return NULL;
178
179 if (pblock)
180 *pblock = b;
181 return bl;
182}
183
184/* Return true if the blockvector BV contains PC, false otherwise. */
185
186int
346d1dfe 187blockvector_contains_pc (const struct blockvector *bv, CORE_ADDR pc)
9703b513
TT
188{
189 return find_block_in_blockvector (bv, pc) != NULL;
fe898f56
DC
190}
191
8e3b41a9
JK
192/* Return call_site for specified PC in GDBARCH. PC must match exactly, it
193 must be the next instruction after call (or after tail call jump). Throw
194 NO_ENTRY_VALUE_ERROR otherwise. This function never returns NULL. */
195
196struct call_site *
197call_site_for_pc (struct gdbarch *gdbarch, CORE_ADDR pc)
198{
199 struct symtab *symtab;
200 void **slot = NULL;
201
202 /* -1 as tail call PC can be already after the compilation unit range. */
203 symtab = find_pc_symtab (pc - 1);
204
205 if (symtab != NULL && symtab->call_site_htab != NULL)
206 slot = htab_find_slot (symtab->call_site_htab, &pc, NO_INSERT);
207
208 if (slot == NULL)
209 {
7cbd4a93 210 struct bound_minimal_symbol msym = lookup_minimal_symbol_by_pc (pc);
8e3b41a9
JK
211
212 /* DW_TAG_gnu_call_site will be missing just if GCC could not determine
213 the call target. */
214 throw_error (NO_ENTRY_VALUE_ERROR,
215 _("DW_OP_GNU_entry_value resolving cannot find "
216 "DW_TAG_GNU_call_site %s in %s"),
217 paddress (gdbarch, pc),
7cbd4a93 218 (msym.minsym == NULL ? "???"
efd66ac6 219 : MSYMBOL_PRINT_NAME (msym.minsym)));
8e3b41a9
JK
220 }
221
222 return *slot;
223}
224
fe898f56
DC
225/* Return the blockvector immediately containing the innermost lexical block
226 containing the specified pc value, or 0 if there is none.
227 Backward compatibility, no section. */
228
346d1dfe 229const struct blockvector *
3977b71f 230blockvector_for_pc (CORE_ADDR pc, const struct block **pblock)
fe898f56
DC
231{
232 return blockvector_for_pc_sect (pc, find_pc_mapped_section (pc),
801e3a5b 233 pblock, NULL);
fe898f56
DC
234}
235
236/* Return the innermost lexical block containing the specified pc value
237 in the specified section, or 0 if there is none. */
238
3977b71f 239const struct block *
714835d5 240block_for_pc_sect (CORE_ADDR pc, struct obj_section *section)
fe898f56 241{
346d1dfe 242 const struct blockvector *bl;
3977b71f 243 const struct block *b;
fe898f56 244
801e3a5b 245 bl = blockvector_for_pc_sect (pc, section, &b, NULL);
fe898f56 246 if (bl)
801e3a5b 247 return b;
fe898f56
DC
248 return 0;
249}
250
251/* Return the innermost lexical block containing the specified pc value,
252 or 0 if there is none. Backward compatibility, no section. */
253
3977b71f 254const struct block *
b59661bd 255block_for_pc (CORE_ADDR pc)
fe898f56
DC
256{
257 return block_for_pc_sect (pc, find_pc_mapped_section (pc));
258}
9219021c 259
1fcb5155
DC
260/* Now come some functions designed to deal with C++ namespace issues.
261 The accessors are safe to use even in the non-C++ case. */
262
263/* This returns the namespace that BLOCK is enclosed in, or "" if it
264 isn't enclosed in a namespace at all. This travels the chain of
265 superblocks looking for a scope, if necessary. */
266
267const char *
268block_scope (const struct block *block)
269{
270 for (; block != NULL; block = BLOCK_SUPERBLOCK (block))
271 {
272 if (BLOCK_NAMESPACE (block) != NULL
273 && BLOCK_NAMESPACE (block)->scope != NULL)
274 return BLOCK_NAMESPACE (block)->scope;
275 }
276
277 return "";
278}
9219021c
DC
279
280/* Set BLOCK's scope member to SCOPE; if needed, allocate memory via
281 OBSTACK. (It won't make a copy of SCOPE, however, so that already
282 has to be allocated correctly.) */
283
284void
285block_set_scope (struct block *block, const char *scope,
286 struct obstack *obstack)
287{
288 block_initialize_namespace (block, obstack);
289
290 BLOCK_NAMESPACE (block)->scope = scope;
291}
292
27aa8d6a 293/* This returns the using directives list associated with BLOCK, if
1fcb5155
DC
294 any. */
295
1fcb5155
DC
296struct using_direct *
297block_using (const struct block *block)
298{
27aa8d6a 299 if (block == NULL || BLOCK_NAMESPACE (block) == NULL)
1fcb5155
DC
300 return NULL;
301 else
27aa8d6a 302 return BLOCK_NAMESPACE (block)->using;
1fcb5155
DC
303}
304
9219021c
DC
305/* Set BLOCK's using member to USING; if needed, allocate memory via
306 OBSTACK. (It won't make a copy of USING, however, so that already
307 has to be allocated correctly.) */
308
309void
310block_set_using (struct block *block,
311 struct using_direct *using,
312 struct obstack *obstack)
313{
314 block_initialize_namespace (block, obstack);
315
316 BLOCK_NAMESPACE (block)->using = using;
317}
318
319/* If BLOCK_NAMESPACE (block) is NULL, allocate it via OBSTACK and
320 ititialize its members to zero. */
321
322static void
323block_initialize_namespace (struct block *block, struct obstack *obstack)
324{
325 if (BLOCK_NAMESPACE (block) == NULL)
326 {
327 BLOCK_NAMESPACE (block)
328 = obstack_alloc (obstack, sizeof (struct block_namespace_info));
329 BLOCK_NAMESPACE (block)->scope = NULL;
330 BLOCK_NAMESPACE (block)->using = NULL;
331 }
332}
89a9d1b1
DC
333
334/* Return the static block associated to BLOCK. Return NULL if block
335 is NULL or if block is a global block. */
336
337const struct block *
338block_static_block (const struct block *block)
339{
340 if (block == NULL || BLOCK_SUPERBLOCK (block) == NULL)
341 return NULL;
342
343 while (BLOCK_SUPERBLOCK (BLOCK_SUPERBLOCK (block)) != NULL)
344 block = BLOCK_SUPERBLOCK (block);
345
346 return block;
347}
1fcb5155
DC
348
349/* Return the static block associated to BLOCK. Return NULL if block
350 is NULL. */
351
352const struct block *
353block_global_block (const struct block *block)
354{
355 if (block == NULL)
356 return NULL;
357
358 while (BLOCK_SUPERBLOCK (block) != NULL)
359 block = BLOCK_SUPERBLOCK (block);
360
361 return block;
362}
5c4e30ca
DC
363
364/* Allocate a block on OBSTACK, and initialize its elements to
365 zero/NULL. This is useful for creating "dummy" blocks that don't
366 correspond to actual source files.
367
368 Warning: it sets the block's BLOCK_DICT to NULL, which isn't a
369 valid value. If you really don't want the block to have a
370 dictionary, then you should subsequently set its BLOCK_DICT to
371 dict_create_linear (obstack, NULL). */
372
373struct block *
374allocate_block (struct obstack *obstack)
375{
4c35218e 376 struct block *bl = OBSTACK_ZALLOC (obstack, struct block);
5c4e30ca
DC
377
378 return bl;
379}
8157b174 380
84a146c9
TT
381/* Allocate a global block. */
382
383struct block *
384allocate_global_block (struct obstack *obstack)
385{
386 struct global_block *bl = OBSTACK_ZALLOC (obstack, struct global_block);
387
388 return &bl->block;
389}
390
391/* Set the symtab of the global block. */
392
393void
394set_block_symtab (struct block *block, struct symtab *symtab)
395{
396 struct global_block *gb;
397
398 gdb_assert (BLOCK_SUPERBLOCK (block) == NULL);
399 gb = (struct global_block *) block;
400 gdb_assert (gb->symtab == NULL);
401 gb->symtab = symtab;
402}
403
b5b04b5b
TT
404/* Return the symtab of the global block. */
405
406static struct symtab *
407get_block_symtab (const struct block *block)
408{
409 struct global_block *gb;
410
411 gdb_assert (BLOCK_SUPERBLOCK (block) == NULL);
412 gb = (struct global_block *) block;
413 gdb_assert (gb->symtab != NULL);
414 return gb->symtab;
415}
416
8157b174
TT
417\f
418
b5b04b5b
TT
419/* Initialize a block iterator, either to iterate over a single block,
420 or, for static and global blocks, all the included symtabs as
421 well. */
422
423static void
424initialize_block_iterator (const struct block *block,
425 struct block_iterator *iter)
426{
427 enum block_enum which;
428 struct symtab *symtab;
429
430 iter->idx = -1;
431
432 if (BLOCK_SUPERBLOCK (block) == NULL)
433 {
434 which = GLOBAL_BLOCK;
435 symtab = get_block_symtab (block);
436 }
437 else if (BLOCK_SUPERBLOCK (BLOCK_SUPERBLOCK (block)) == NULL)
438 {
439 which = STATIC_BLOCK;
440 symtab = get_block_symtab (BLOCK_SUPERBLOCK (block));
441 }
442 else
443 {
444 iter->d.block = block;
445 /* A signal value meaning that we're iterating over a single
446 block. */
447 iter->which = FIRST_LOCAL_BLOCK;
448 return;
449 }
450
451 /* If this is an included symtab, find the canonical includer and
452 use it instead. */
453 while (symtab->user != NULL)
454 symtab = symtab->user;
455
456 /* Putting this check here simplifies the logic of the iterator
457 functions. If there are no included symtabs, we only need to
458 search a single block, so we might as well just do that
459 directly. */
460 if (symtab->includes == NULL)
461 {
462 iter->d.block = block;
463 /* A signal value meaning that we're iterating over a single
464 block. */
465 iter->which = FIRST_LOCAL_BLOCK;
466 }
467 else
468 {
469 iter->d.symtab = symtab;
470 iter->which = which;
471 }
472}
473
474/* A helper function that finds the current symtab over whose static
475 or global block we should iterate. */
476
477static struct symtab *
478find_iterator_symtab (struct block_iterator *iterator)
479{
480 if (iterator->idx == -1)
481 return iterator->d.symtab;
482 return iterator->d.symtab->includes[iterator->idx];
483}
484
485/* Perform a single step for a plain block iterator, iterating across
486 symbol tables as needed. Returns the next symbol, or NULL when
487 iteration is complete. */
488
489static struct symbol *
490block_iterator_step (struct block_iterator *iterator, int first)
491{
492 struct symbol *sym;
493
494 gdb_assert (iterator->which != FIRST_LOCAL_BLOCK);
495
496 while (1)
497 {
498 if (first)
499 {
500 struct symtab *symtab = find_iterator_symtab (iterator);
501 const struct block *block;
502
503 /* Iteration is complete. */
504 if (symtab == NULL)
505 return NULL;
506
439247b6
DE
507 block = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (symtab),
508 iterator->which);
b5b04b5b
TT
509 sym = dict_iterator_first (BLOCK_DICT (block), &iterator->dict_iter);
510 }
511 else
512 sym = dict_iterator_next (&iterator->dict_iter);
513
514 if (sym != NULL)
515 return sym;
516
517 /* We have finished iterating the appropriate block of one
518 symtab. Now advance to the next symtab and begin iteration
519 there. */
520 ++iterator->idx;
521 first = 1;
522 }
523}
524
8157b174
TT
525/* See block.h. */
526
527struct symbol *
528block_iterator_first (const struct block *block,
529 struct block_iterator *iterator)
530{
b5b04b5b
TT
531 initialize_block_iterator (block, iterator);
532
533 if (iterator->which == FIRST_LOCAL_BLOCK)
534 return dict_iterator_first (block->dict, &iterator->dict_iter);
535
536 return block_iterator_step (iterator, 1);
8157b174
TT
537}
538
539/* See block.h. */
540
541struct symbol *
542block_iterator_next (struct block_iterator *iterator)
543{
b5b04b5b
TT
544 if (iterator->which == FIRST_LOCAL_BLOCK)
545 return dict_iterator_next (&iterator->dict_iter);
546
547 return block_iterator_step (iterator, 0);
548}
549
550/* Perform a single step for a "name" block iterator, iterating across
551 symbol tables as needed. Returns the next symbol, or NULL when
552 iteration is complete. */
553
554static struct symbol *
555block_iter_name_step (struct block_iterator *iterator, const char *name,
556 int first)
557{
558 struct symbol *sym;
559
560 gdb_assert (iterator->which != FIRST_LOCAL_BLOCK);
561
562 while (1)
563 {
564 if (first)
565 {
566 struct symtab *symtab = find_iterator_symtab (iterator);
567 const struct block *block;
568
569 /* Iteration is complete. */
570 if (symtab == NULL)
571 return NULL;
572
439247b6
DE
573 block = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (symtab),
574 iterator->which);
b5b04b5b
TT
575 sym = dict_iter_name_first (BLOCK_DICT (block), name,
576 &iterator->dict_iter);
577 }
578 else
579 sym = dict_iter_name_next (name, &iterator->dict_iter);
580
581 if (sym != NULL)
582 return sym;
583
584 /* We have finished iterating the appropriate block of one
585 symtab. Now advance to the next symtab and begin iteration
586 there. */
587 ++iterator->idx;
588 first = 1;
589 }
8157b174
TT
590}
591
592/* See block.h. */
593
594struct symbol *
595block_iter_name_first (const struct block *block,
596 const char *name,
597 struct block_iterator *iterator)
598{
b5b04b5b
TT
599 initialize_block_iterator (block, iterator);
600
601 if (iterator->which == FIRST_LOCAL_BLOCK)
602 return dict_iter_name_first (block->dict, name, &iterator->dict_iter);
603
604 return block_iter_name_step (iterator, name, 1);
8157b174
TT
605}
606
607/* See block.h. */
608
609struct symbol *
610block_iter_name_next (const char *name, struct block_iterator *iterator)
611{
b5b04b5b
TT
612 if (iterator->which == FIRST_LOCAL_BLOCK)
613 return dict_iter_name_next (name, &iterator->dict_iter);
614
615 return block_iter_name_step (iterator, name, 0);
616}
617
618/* Perform a single step for a "match" block iterator, iterating
619 across symbol tables as needed. Returns the next symbol, or NULL
620 when iteration is complete. */
621
622static struct symbol *
623block_iter_match_step (struct block_iterator *iterator,
624 const char *name,
625 symbol_compare_ftype *compare,
626 int first)
627{
628 struct symbol *sym;
629
630 gdb_assert (iterator->which != FIRST_LOCAL_BLOCK);
631
632 while (1)
633 {
634 if (first)
635 {
636 struct symtab *symtab = find_iterator_symtab (iterator);
637 const struct block *block;
638
639 /* Iteration is complete. */
640 if (symtab == NULL)
641 return NULL;
642
439247b6
DE
643 block = BLOCKVECTOR_BLOCK (SYMTAB_BLOCKVECTOR (symtab),
644 iterator->which);
b5b04b5b
TT
645 sym = dict_iter_match_first (BLOCK_DICT (block), name,
646 compare, &iterator->dict_iter);
647 }
648 else
649 sym = dict_iter_match_next (name, compare, &iterator->dict_iter);
650
651 if (sym != NULL)
652 return sym;
653
654 /* We have finished iterating the appropriate block of one
655 symtab. Now advance to the next symtab and begin iteration
656 there. */
657 ++iterator->idx;
658 first = 1;
659 }
8157b174
TT
660}
661
662/* See block.h. */
663
664struct symbol *
665block_iter_match_first (const struct block *block,
666 const char *name,
667 symbol_compare_ftype *compare,
668 struct block_iterator *iterator)
669{
b5b04b5b
TT
670 initialize_block_iterator (block, iterator);
671
672 if (iterator->which == FIRST_LOCAL_BLOCK)
673 return dict_iter_match_first (block->dict, name, compare,
674 &iterator->dict_iter);
675
676 return block_iter_match_step (iterator, name, compare, 1);
8157b174
TT
677}
678
679/* See block.h. */
680
681struct symbol *
682block_iter_match_next (const char *name,
683 symbol_compare_ftype *compare,
684 struct block_iterator *iterator)
685{
b5b04b5b
TT
686 if (iterator->which == FIRST_LOCAL_BLOCK)
687 return dict_iter_match_next (name, compare, &iterator->dict_iter);
688
689 return block_iter_match_step (iterator, name, compare, 0);
8157b174 690}
16b2eaa1
DE
691
692/* See block.h.
693
694 Note that if NAME is the demangled form of a C++ symbol, we will fail
695 to find a match during the binary search of the non-encoded names, but
696 for now we don't worry about the slight inefficiency of looking for
697 a match we'll never find, since it will go pretty quick. Once the
698 binary search terminates, we drop through and do a straight linear
699 search on the symbols. Each symbol which is marked as being a ObjC/C++
700 symbol (language_cplus or language_objc set) has both the encoded and
701 non-encoded names tested for a match. */
702
703struct symbol *
704block_lookup_symbol (const struct block *block, const char *name,
705 const domain_enum domain)
706{
707 struct block_iterator iter;
708 struct symbol *sym;
709
710 if (!BLOCK_FUNCTION (block))
711 {
358d6ab3 712 ALL_BLOCK_SYMBOLS_WITH_NAME (block, name, iter, sym)
16b2eaa1
DE
713 {
714 if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
715 SYMBOL_DOMAIN (sym), domain))
716 return sym;
717 }
718 return NULL;
719 }
720 else
721 {
722 /* Note that parameter symbols do not always show up last in the
723 list; this loop makes sure to take anything else other than
724 parameter symbols first; it only uses parameter symbols as a
725 last resort. Note that this only takes up extra computation
726 time on a match. */
727
728 struct symbol *sym_found = NULL;
729
358d6ab3 730 ALL_BLOCK_SYMBOLS_WITH_NAME (block, name, iter, sym)
16b2eaa1
DE
731 {
732 if (symbol_matches_domain (SYMBOL_LANGUAGE (sym),
733 SYMBOL_DOMAIN (sym), domain))
734 {
735 sym_found = sym;
736 if (!SYMBOL_IS_ARGUMENT (sym))
737 {
738 break;
739 }
740 }
741 }
742 return (sym_found); /* Will be NULL if not found. */
743 }
744}
This page took 0.815142 seconds and 4 git commands to generate.