[v2,2/7] Small constructor change to target_buffer

Message ID 20230918-gdb-bfd-vec-v2-2-162c0e9a2bc9@adacore.com
State New
Headers
Series Rewrite gdb_bfd_openr_iovec to be type-safe |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Testing passed

Commit Message

Tom Tromey Sept. 18, 2023, 2:52 p.m. UTC
  This changes the target_buffer constructor to initialize m_filename
rather than assign to it.
---
 gdb/gdb_bfd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Patch

diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c
index de7ecaea630..6b64e92b48e 100644
--- a/gdb/gdb_bfd.c
+++ b/gdb/gdb_bfd.c
@@ -226,10 +226,10 @@  struct target_buffer
      target memory.  */
   target_buffer (CORE_ADDR base, ULONGEST size)
     : m_base (base),
-      m_size (size)
+      m_size (size),
+      m_filename (xstrprintf ("<in-memory@%s>",
+			      core_addr_to_string_nz (m_base)))
   {
-    m_filename
-      = xstrprintf ("<in-memory@%s>", core_addr_to_string_nz (m_base));
   }
 
   /* Return the size of the in-memory BFD file.  */