From: Tom de Vries Date: Thu, 23 Apr 2026 06:35:30 +0000 (+0200) Subject: Use block::function_blocks X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b22fc8ee9ba1e3decc46db5d6115416d4eb4a3a5;p=thirdparty%2Fbinutils-gdb.git Use block::function_blocks Add a use of block::function_blocks --- diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index da6c3b04dd9..fa465d2439b 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -13120,32 +13120,27 @@ ada_add_exceptions_from_frame (compiled_regex *preg, const frame_info_ptr &frame, std::vector *exceptions) { - const struct block *block = get_frame_block (frame, 0); + const struct block *frame_block = get_frame_block (frame, 0); - while (block != 0) - { - for (struct symbol *sym : block_iterator_range (block)) - { - switch (sym->loc_class ()) - { - case LOC_TYPEDEF: - case LOC_BLOCK: - case LOC_CONST: - break; - default: - if (ada_is_exception_sym (sym)) - { - struct ada_exc_info info = {sym->print_name (), - sym->value_address ()}; + for (auto block : block::function_blocks (frame_block)) + for (struct symbol *sym : block_iterator_range (block)) + { + switch (sym->loc_class ()) + { + case LOC_TYPEDEF: + case LOC_BLOCK: + case LOC_CONST: + break; + default: + if (ada_is_exception_sym (sym)) + { + struct ada_exc_info info = {sym->print_name (), + sym->value_address ()}; - exceptions->push_back (info); - } - } - } - if (block->function () != NULL) - break; - block = block->superblock (); - } + exceptions->push_back (info); + } + } + } } /* Add all exceptions defined globally whose name name match