From: Simon Marchi Date: Mon, 3 Nov 2025 17:45:10 +0000 (-0500) Subject: gdb: introduce blockvector_up X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6f4cb3ab5ae8b390a7eecf54b13cf193b82d6ccc;p=thirdparty%2Fbinutils-gdb.git gdb: introduce blockvector_up Change-Id: Id43c5982969f85b5931ba8a32d208a7326ed3492 Approved-By: Tom Tromey --- diff --git a/gdb/block.h b/gdb/block.h index 78fa375a473..87ef7fab197 100644 --- a/gdb/block.h +++ b/gdb/block.h @@ -512,6 +512,8 @@ private: std::vector m_blocks; }; +using blockvector_up = std::unique_ptr; + extern const struct blockvector *blockvector_for_pc (CORE_ADDR, const struct block **); diff --git a/gdb/buildsym.c b/gdb/buildsym.c index b757c78eb36..750f049d720 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -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; 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. */ diff --git a/gdb/buildsym.h b/gdb/buildsym.h index 2a64ad5640b..f7fb2c2c452 100644 --- a/gdb/buildsym.h +++ b/gdb/buildsym.h @@ -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 make_blockvector (); + blockvector_up make_blockvector (); void watch_main_source_file_lossage ();