public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [pushed] gdb: use gdb::byte_vector instead of gdb::def_vector<gdb_byte>
@ 2023-11-01 17:06 Simon Marchi
  0 siblings, 0 replies; only message in thread
From: Simon Marchi @ 2023-11-01 17:06 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

Use the gdb::byte_vector typedef when possible.

Change-Id: Ib2199201c052496992011ea02979de023d4d8a9a
---
 gdb/linux-tdep.c    | 2 +-
 gdb/regcache-dump.c | 2 +-
 gdb/regcache.c      | 6 +++---
 gdb/sparc64-tdep.c  | 2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c
index f7b8a5940976..eff7a0ca42e6 100644
--- a/gdb/linux-tdep.c
+++ b/gdb/linux-tdep.c
@@ -1148,7 +1148,7 @@ linux_read_core_file_mappings
       return;
     }
 
-  gdb::def_vector<gdb_byte> contents (note_size);
+  gdb::byte_vector contents (note_size);
   if (!bfd_get_section_contents (core_bfd, section, contents.data (),
 				 0, note_size))
     {
diff --git a/gdb/regcache-dump.c b/gdb/regcache-dump.c
index 5f4389502564..585e02eefed5 100644
--- a/gdb/regcache-dump.c
+++ b/gdb/regcache-dump.c
@@ -57,7 +57,7 @@ class register_dump_regcache : public register_dump
 	    if (size == 0)
 	      return;
 
-	    gdb::def_vector<gdb_byte> buf (size);
+	    gdb::byte_vector buf (size);
 	    auto status = m_regcache->cooked_read (regnum, buf.data ());
 
 	    if (status == REG_UNKNOWN)
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 5acac2b8e472..2e48c0258091 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -1884,7 +1884,7 @@ cooked_read_test (struct gdbarch *gdbarch)
 
   readwrite_regcache readwrite (&mockctx.mock_inferior, gdbarch);
   readwrite.set_ptid (mockctx.mock_ptid);
-  gdb::def_vector<gdb_byte> buf (register_size (gdbarch, nonzero_regnum));
+  gdb::byte_vector buf (register_size (gdbarch, nonzero_regnum));
 
   readwrite.raw_read (nonzero_regnum, buf.data ());
 
@@ -1905,7 +1905,7 @@ cooked_read_test (struct gdbarch *gdbarch)
       if (register_size (gdbarch, regnum) == 0)
 	continue;
 
-      gdb::def_vector<gdb_byte> inner_buf (register_size (gdbarch, regnum));
+      gdb::byte_vector inner_buf (register_size (gdbarch, regnum));
 
       SELF_CHECK (REG_VALID == readwrite.cooked_read (regnum,
 						      inner_buf.data ()));
@@ -1928,7 +1928,7 @@ cooked_read_test (struct gdbarch *gdbarch)
       if (register_size (gdbarch, regnum) == 0)
 	continue;
 
-      gdb::def_vector<gdb_byte> inner_buf (register_size (gdbarch, regnum));
+      gdb::byte_vector inner_buf (register_size (gdbarch, regnum));
       enum register_status status = readonly.cooked_read (regnum,
 							  inner_buf.data ());
 
diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c
index 5cf384f9eac2..abbbb73d1db9 100644
--- a/gdb/sparc64-tdep.c
+++ b/gdb/sparc64-tdep.c
@@ -412,7 +412,7 @@ do_examine (CORE_ADDR start, int bcnt)
 
   CORE_ADDR vstart = adi_align_address (vaddr);
   int cnt = adi_convert_byte_count (vaddr, bcnt, vstart);
-  gdb::def_vector<gdb_byte> buf (cnt);
+  gdb::byte_vector buf (cnt);
   int read_cnt = adi_read_versions (vstart, cnt, buf.data ());
   if (read_cnt == -1)
     error (_("No ADI information"));

base-commit: 5fbee060e807fbc317aa265eb7e25d1cf94a4dad
-- 
2.42.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-01 17:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-01 17:06 [pushed] gdb: use gdb::byte_vector instead of gdb::def_vector<gdb_byte> Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).