Add FreeBSD/aarch64 architecture.
[deliverable/binutils-gdb.git] / gdb / cp-valprint.c
index 143bb48db37c08877d11b07ea66b4f256a55104d..af70421fd774a07b8b33ee5a6c148c8e3f3515b8 100644 (file)
@@ -35,6 +35,7 @@
 #include "language.h"
 #include "extension.h"
 #include "typeprint.h"
+#include "byte-vector.h"
 
 /* Controls printing of vtbl's.  */
 static void
@@ -534,23 +535,18 @@ cp_print_value (struct type *type, struct type *real_type,
              if ((boffset + offset) < 0
                  || (boffset + offset) >= TYPE_LENGTH (real_type))
                {
-                 gdb_byte *buf;
-                 struct cleanup *back_to;
+                 gdb::byte_vector buf (TYPE_LENGTH (baseclass));
 
-                 buf = (gdb_byte *) xmalloc (TYPE_LENGTH (baseclass));
-                 back_to = make_cleanup (xfree, buf);
-
-                 if (target_read_memory (address + boffset, buf,
+                 if (target_read_memory (address + boffset, buf.data (),
                                          TYPE_LENGTH (baseclass)) != 0)
                    skip = 1;
                  base_val = value_from_contents_and_address (baseclass,
-                                                             buf,
+                                                             buf.data (),
                                                              address + boffset);
                  baseclass = value_type (base_val);
                  thisoffset = 0;
                  boffset = 0;
                  thistype = baseclass;
-                 do_cleanups (back_to);
                }
              else
                {
@@ -759,7 +755,7 @@ cp_find_class_member (struct type **self_p, int *fieldno,
 
 void
 cp_print_class_member (const gdb_byte *valaddr, struct type *type,
-                      struct ui_file *stream, char *prefix)
+                      struct ui_file *stream, const char *prefix)
 {
   enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type));
 
This page took 0.023916 seconds and 4 git commands to generate.