Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Simplify get_frame_unwind_table
@ 2025-01-17 19:04 Tom Tromey
  2025-01-17 19:14 ` Guinevere Larsen
  0 siblings, 1 reply; 5+ messages in thread
From: Tom Tromey @ 2025-01-17 19:04 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

This simplifies get_frame_unwind_table, changing it to use the
registry 'emplace' method and to pass the initialization iterators to
the constructor.  This fixes a build problem on x86 -- reported by the
auto-builder -- as a side effect.
---
 gdb/frame-unwind.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c
index fab9b3c981a..33b23f91feb 100644
--- a/gdb/frame-unwind.c
+++ b/gdb/frame-unwind.c
@@ -73,15 +73,10 @@ 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;
 }
 
-- 
2.47.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-01-18 15:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-17 19:04 [PATCH] Simplify get_frame_unwind_table Tom Tromey
2025-01-17 19:14 ` Guinevere Larsen
2025-01-17 20:33   ` Guinevere Larsen
2025-01-17 21:27     ` Tom Tromey
2025-01-18 15:25       ` Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox