]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: fix recent build breakage on 32 bit systems users/guinevere/try-build-break
authorGuinevere Larsen <guinevere@redhat.com>
Fri, 17 Jan 2025 18:33:11 +0000 (15:33 -0300)
committerGuinevere Larsen <guinevere@redhat.com>
Fri, 17 Jan 2025 18:33:11 +0000 (15:33 -0300)
The recent commit 3919cf8a704138e4f2dd79c66e33a62087180f1f caused a
build breakage on the 32-bit debian try bot. This seems related to how
the patch allocates space for the frame unwinder table in a gdbarch.
This commit changes that allocation to be in-place.

gdb/frame-unwind.c

index fab9b3c981abc3f5ed6d8e91759cedebee93197d..c63f8aa0d3e10b8ddb44975c29fa0139ad40dbd3 100644 (file)
@@ -73,14 +73,9 @@ static std::vector<const frame_unwind *> &
 get_frame_unwind_table (struct gdbarch *gdbarch)
 {
   std::vector<const frame_unwind *> *table = frame_unwind_data.get (gdbarch);
-  if (table != nullptr)
-    return *table;
-
-  table = new std::vector<const frame_unwind *>;
-  table->insert (table->begin (), standard_unwinders.begin (),
-                standard_unwinders.end ());
-
-  frame_unwind_data.set (gdbarch, table);
+  if (table == nullptr)
+    table = frame_unwind_data.emplace (gdbarch, standard_unwinders.begin (),
+                                      standard_unwinders.end ());
 
   return *table;
 }