]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/inferior.h
gdb: remove push_target free functions
[thirdparty/binutils-gdb.git] / gdb / inferior.h
index b8d5ff94fc56742996149f17fdecaeb7d48e5cc4..66fc180ce53034f05204c2d0bdac8bbb8d47f741 100644 (file)
@@ -352,6 +352,13 @@ public:
   void push_target (struct target_ops *t)
   { m_target_stack.push (t); }
 
+  /* An overload that deletes the target on failure.  */
+  void push_target (target_ops_up &&t)
+  {
+    m_target_stack.push (t.get ());
+    t.release ();
+  }
+
   /* Unpush T from this inferior's target stack.  */
   int unpush_target (struct target_ops *t)
   { return m_target_stack.unpush (t); }