[binutils-gdb] gdb/linux: remove redundant struct prefixes from smaps_data

Matthieu Longo mlongo@sourceware.org
Fri Nov 6 10:53:03 GMT 2026


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=574d6e57a96c9016a06a8547e4b1f846d710a011

commit 574d6e57a96c9016a06a8547e4b1f846d710a011
Author: Matthieu Longo <matthieu.longo@arm.com>
Date:   Thu Sep 17 15:58:06 2026 +0100

    gdb/linux: remove redundant struct prefixes from smaps_data
    
    Remove the redundant 'struct' prefix from uses of smaps_data in
    linux-tdep.c. In C++, the structure name can be used directly as
    a type name.
    
    Suggested-By: Christina Joos <christina.joos@intel.com>
    Approved-By: Tom Tromey <tom@tromey.com>

Diff:
---
 gdb/linux-tdep.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c
index 4f6910694d5..799117a6d1b 100644
--- a/gdb/linux-tdep.c
+++ b/gdb/linux-tdep.c
@@ -1551,7 +1551,7 @@ parse_smaps_key_value (const char *keyword, const char *line,
    DATA is the contents of the smaps file.  The parsed contents are stored
    into the SMAPS vector.  */
 
-static std::vector<struct smaps_data>
+static std::vector<smaps_data>
 parse_smaps_data (const char *data,
 		  const std::string &maps_filename)
 {
@@ -1561,7 +1561,7 @@ parse_smaps_data (const char *data,
 
   line = strtok_r ((char *) data, "\n", &t);
 
-  std::vector<struct smaps_data> smaps;
+  std::vector<smaps_data> smaps;
 
   while (line != NULL)
     {
@@ -1673,7 +1673,7 @@ parse_smaps_data (const char *data,
 	    }
 	}
       /* Save the smaps entry to the vector.  */
-	struct smaps_data map;
+	smaps_data map;
 
 	map.start_address = m.addr;
 	map.end_address = m.endaddr;
@@ -1716,7 +1716,7 @@ linux_process_address_in_memtag_page (CORE_ADDR address)
     return false;
 
   /* Parse the contents of smaps into a vector.  */
-  std::vector<struct smaps_data> smaps
+  std::vector<smaps_data> smaps
     = parse_smaps_data (data.get (), smaps_file);
 
   for (const smaps_data &map : smaps)
@@ -1812,10 +1812,10 @@ linux_find_memory_regions_full (struct gdbarch *gdbarch,
     }
 
   /* Parse the contents of smaps into a vector.  */
-  std::vector<struct smaps_data> smaps
+  std::vector<smaps_data> smaps
     = parse_smaps_data (data.get (), maps_filename);
 
-  for (const struct smaps_data &map : smaps)
+  for (const smaps_data &map : smaps)
     {
       /* Invoke the callback function to create the corefile segment.  */
       if (should_dump_mapping_p (filterflags, map))


More information about the Gdb-cvs mailing list