]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: introduce blockvector_up
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 3 Nov 2025 17:45:10 +0000 (12:45 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 3 Nov 2025 21:41:27 +0000 (16:41 -0500)
Change-Id: Id43c5982969f85b5931ba8a32d208a7326ed3492
Approved-By: Tom Tromey <tom@tromey.com>
gdb/block.h
gdb/buildsym.c
gdb/buildsym.h

index 78fa375a473b3c215720155865532f75315dd5b7..87ef7fab1974982551543b31b053284c8c64b695 100644 (file)
@@ -512,6 +512,8 @@ private:
   std::vector<struct block *> m_blocks;
 };
 
+using blockvector_up = std::unique_ptr<blockvector>;
+
 extern const struct blockvector *blockvector_for_pc (CORE_ADDR,
                                               const struct block **);
 
index b757c78eb3607539e93938fc34d0fd1be6ff239c..750f049d7204c8d5b4b2952fd1e67c0831175e23 100644 (file)
@@ -830,7 +830,6 @@ buildsym_compunit::end_compunit_symtab_from_static_block
   (struct block *static_block, bool expandable)
 {
   struct compunit_symtab *cu = m_compunit_symtab;
-  std::unique_ptr<blockvector> blockvector;
   struct subfile *subfile;
   CORE_ADDR end_addr;
 
@@ -856,7 +855,7 @@ buildsym_compunit::end_compunit_symtab_from_static_block
   finish_block_internal (NULL, get_global_symbols (), NULL, NULL,
                         m_last_source_start_addr, end_addr,
                         true, expandable);
-  blockvector = make_blockvector ();
+  blockvector_up blockvector = make_blockvector ();
 
   /* Read the line table if it has to be read separately.
      This is only used by xcoffread.c.  */
index 2a64ad5640b4ace757f515d88c671f12b4680076..f7fb2c2c4529f287a1d60004bcac28353072d2c4 100644 (file)
@@ -19,6 +19,7 @@
 #ifndef GDB_BUILDSYM_H
 #define GDB_BUILDSYM_H
 
+#include "block.h"
 #include "gdbsupport/gdb_obstack.h"
 #include "symtab.h"
 #include "addrmap.h"
@@ -344,7 +345,7 @@ private:
                                       CORE_ADDR start, CORE_ADDR end,
                                       bool is_global, bool expandable);
 
-  std::unique_ptr<blockvector> make_blockvector ();
+  blockvector_up make_blockvector ();
 
   void watch_main_source_file_lossage ();