Add push_target overload

This adds a push_target overload that takes a "target_ops_up &&".
This removes some calls to release a target_ops_up, and makes the
intent here clearer.

gdb/ChangeLog
2019-02-15  Tom Tromey  <tromey@adacore.com>

	* target.h (push_target): Declare new overload.
	* target.c (push_target): New overload, taking an rvalue reference.
	* remote.c (remote_target::open_1): Use push_target overload.
	* corelow.c (core_target_open): Use push_target overload.
This commit is contained in:
Tom Tromey
2019-02-06 02:54:17 -07:00
parent 989f3c583d
commit dea57a6263
5 changed files with 21 additions and 5 deletions

View File

@@ -2333,6 +2333,9 @@ extern void add_deprecated_target_alias (const target_info &info,
extern void push_target (struct target_ops *);
/* An overload that deletes the target on failure. */
extern void push_target (target_ops_up &&);
extern int unpush_target (struct target_ops *);
extern void target_pre_inferior (int);