]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Use block::function_blocks
authorTom de Vries <tdevries@suse.de>
Thu, 23 Apr 2026 06:35:30 +0000 (08:35 +0200)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 30 Apr 2026 15:00:32 +0000 (11:00 -0400)
Add a use of block::function_blocks

gdb/ada-lang.c

index da6c3b04dd994947ba103af38e8f46a284b23a09..fa465d2439b184335891b5d3fc07d5942cc5fabc 100644 (file)
@@ -13120,32 +13120,27 @@ ada_add_exceptions_from_frame (compiled_regex *preg,
                               const frame_info_ptr &frame,
                               std::vector<ada_exc_info> *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