aboutsummaryrefslogtreecommitdiff
path: root/gdb/ppc-linux-tdep.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2017-09-23 15:34:30 -0600
committerTom Tromey <tom@tromey.com>2017-09-25 19:54:07 -0600
commit9ac86b52da268147b2565e4920357432bb7a34c3 (patch)
treeecd744af89f932b6cad7bfcce62c28a91c33e85a /gdb/ppc-linux-tdep.c
parentc0e383c63818baee1daf51b8fb1bae34d1e0597f (diff)
downloadgdb-9ac86b52da268147b2565e4920357432bb7a34c3.zip
gdb-9ac86b52da268147b2565e4920357432bb7a34c3.tar.gz
gdb-9ac86b52da268147b2565e4920357432bb7a34c3.tar.bz2
Remove make_cleanup_regcache_xfree
This removes make_cleanup_regcache_xfree in favor of using std::unique_ptr as the return type of frame_save_as_regcache. gdb/ChangeLog 2017-09-25 Tom Tromey <tom@tromey.com> * spu-tdep.c (spu2ppu_sniffer): Update. * regcache.h (make_cleanup_regcache_xfree): Don't declare. * regcache.c (do_regcache_xfree, make_cleanup_regcache_xfree): Remove. * ppc-linux-tdep.c (ppu2spu_sniffer): Update. * mi/mi-main.c (mi_cmd_data_list_changed_registers): Update. * frame.h (frame_save_as_regcache): Return std::unique_ptr. * frame.c (frame_save_as_regcache): Return std::unique_ptr. (frame_pop): Update.
Diffstat (limited to 'gdb/ppc-linux-tdep.c')
-rw-r--r--gdb/ppc-linux-tdep.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index 2faee42..5f313f8 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -1363,13 +1363,12 @@ ppu2spu_sniffer (const struct frame_unwind *self,
= FRAME_OBSTACK_CALLOC (1, struct ppu2spu_cache);
struct address_space *aspace = get_frame_address_space (this_frame);
- struct regcache *regcache = new regcache (data.gdbarch, aspace);
- struct cleanup *cleanups = make_cleanup_regcache_xfree (regcache);
- regcache_save (regcache, ppu2spu_unwind_register, &data);
- discard_cleanups (cleanups);
+ std::unique_ptr<struct regcache> regcache
+ (new struct regcache (data.gdbarch, aspace));
+ regcache_save (regcache.get (), ppu2spu_unwind_register, &data);
cache->frame_id = frame_id_build (base, func);
- cache->regcache = regcache;
+ cache->regcache = regcache.release ();
*this_prologue_cache = cache;
return 1;
}