Remove regcache_xmalloc
authorTom Tromey <tom@tromey.com>
Sat, 23 Sep 2017 20:39:56 +0000 (14:39 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 26 Sep 2017 01:54:05 +0000 (19:54 -0600)
This patch removes regcache_xmalloc in favor of plain "new".

gdb/ChangeLog
2017-09-25  Tom Tromey  <tom@tromey.com>

* regcache.h (regcache_xmalloc): Don't declare.
(regcache_raw_set_cached_value): Update comment.
* regcache.c (regcache_xmalloc): Remove.
* ppc-linux-tdep.c (ppu2spu_sniffer): Use new.
* jit.c (jit_frame_sniffer): Use new.
* frame.c (frame_save_as_regcache): Use new.

gdb/ChangeLog
gdb/frame.c
gdb/jit.c
gdb/ppc-linux-tdep.c
gdb/regcache.c
gdb/regcache.h

index b6283f6f2a63691bf599cc108675cf69bd12d1a4..b42a38f89c1862f0cc67de9c204a9aceb1bd9bb6 100644 (file)
@@ -1,3 +1,12 @@
+2017-09-25  Tom Tromey  <tom@tromey.com>
+
+       * regcache.h (regcache_xmalloc): Don't declare.
+       (regcache_raw_set_cached_value): Update comment.
+       * regcache.c (regcache_xmalloc): Remove.
+       * ppc-linux-tdep.c (ppu2spu_sniffer): Use new.
+       * jit.c (jit_frame_sniffer): Use new.
+       * frame.c (frame_save_as_regcache): Use new.
+
 2017-09-25  Andreas Arnez  <arnez@linux.vnet.ibm.com>
 
        * NEWS: Advertise support for guarded-storage registers on IBM z.
index f100da356ab6a1aa4fe87fae98fc5e1f4f7511cf..ad0cb9275930558331b7d82c71a47f39023554f7 100644 (file)
@@ -1021,8 +1021,8 @@ struct regcache *
 frame_save_as_regcache (struct frame_info *this_frame)
 {
   struct address_space *aspace = get_frame_address_space (this_frame);
-  struct regcache *regcache = regcache_xmalloc (get_frame_arch (this_frame),
-                                               aspace);
+  struct regcache *regcache = new regcache (get_frame_arch (this_frame),
+                                           aspace);
   struct cleanup *cleanups = make_cleanup_regcache_xfree (regcache);
 
   regcache_save (regcache, do_frame_register_read, this_frame);
index fbfee991c94f989cc5117b99068c581a364b74e6..6eea38fc34b8b6b0812eee4b4bb7c5c526ac6c8d 100644 (file)
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -1205,7 +1205,7 @@ jit_frame_sniffer (const struct frame_unwind *self,
 
   *cache = XCNEW (struct jit_unwind_private);
   priv_data = (struct jit_unwind_private *) *cache;
-  priv_data->regcache = regcache_xmalloc (gdbarch, aspace);
+  priv_data->regcache = new regcache (gdbarch, aspace);
   priv_data->this_frame = this_frame;
 
   callbacks.priv_data = priv_data;
index df664ea5836a1f95e8b0988be80f714f0be3225f..4c851eb4d9ba01dcc7bfe7e18e609261680d9c93 100644 (file)
@@ -1363,7 +1363,7 @@ 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 = regcache_xmalloc (data.gdbarch, aspace);
+         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);
index 4ef9151245840272efe9ea899e39c956d0f94b08..2a92cf02419687e36a861b20624d9b973e994995 100644 (file)
@@ -241,12 +241,6 @@ regcache_get_ptid (const struct regcache *regcache)
   return regcache->ptid ();
 }
 
-struct regcache *
-regcache_xmalloc (struct gdbarch *gdbarch, struct address_space *aspace)
-{
-  return new regcache (gdbarch, aspace);
-}
-
 void
 regcache_xfree (struct regcache *regcache)
 {
index eb0454a0e6d324b6554173b7dc89393fc6cca44c..877ed59b9b5aaac616f75995324c06ffb3f358c9 100644 (file)
@@ -37,8 +37,6 @@ extern struct regcache *get_thread_arch_aspace_regcache (ptid_t,
 
 void regcache_xfree (struct regcache *regcache);
 struct cleanup *make_cleanup_regcache_xfree (struct regcache *regcache);
-struct regcache *regcache_xmalloc (struct gdbarch *gdbarch,
-                                  struct address_space *aspace);
 
 /* Return REGCACHE's ptid.  */
 
@@ -84,7 +82,7 @@ extern LONGEST regcache_raw_get_signed (struct regcache *regcache,
 /* Set a raw register's value in the regcache's buffer.  Unlike
    regcache_raw_write, this is not write-through.  The intention is
    allowing to change the buffer contents of a read-only regcache
-   allocated with regcache_xmalloc.  */
+   allocated with new.  */
 
 extern void regcache_raw_set_cached_value
   (struct regcache *regcache, int regnum, const gdb_byte *buf);
This page took 0.03613 seconds and 4 git commands to generate.