diff options
author | Tom Tromey <tromey@adacore.com> | 2019-02-06 02:54:17 -0700 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2019-02-15 13:53:43 -0700 |
commit | dea57a626364698759d1525acf9109771d173811 (patch) | |
tree | 7385e42d07f72232fa630e5e370ba26f02906f52 /gdb/target.h | |
parent | 989f3c583d31e29029b1b7dd8ffd3afacbbb5c27 (diff) | |
download | gdb-dea57a626364698759d1525acf9109771d173811.zip gdb-dea57a626364698759d1525acf9109771d173811.tar.gz gdb-dea57a626364698759d1525acf9109771d173811.tar.bz2 |
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.
Diffstat (limited to 'gdb/target.h')
-rw-r--r-- | gdb/target.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/target.h b/gdb/target.h index 96413aa..c95151a 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -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); |