gdb/dwarf: initialize tu_stats fields

Message ID 20250225212908.170438-1-simon.marchi@efficios.com
State New
Headers
Series gdb/dwarf: initialize tu_stats fields |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_check--master-arm fail Patch failed to apply

Commit Message

Simon Marchi Feb. 25, 2025, 9:29 p.m. UTC
  Initialize fields of tu_stats to 0, remove the explicit default
initialization of dwarf2_per_bfd::tu_stats.

Change-Id: I98b2d5c4171291a3df2569466559174fb7cf32b6
---
 gdb/dwarf2/read.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)


base-commit: b9935b23e47b6ff43d8099460b09c2e11666aa47
  

Comments

Tom Tromey Feb. 25, 2025, 9:39 p.m. UTC | #1
>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:

Simon> Initialize fields of tu_stats to 0, remove the explicit default
Simon> initialization of dwarf2_per_bfd::tu_stats.

Ok.
Approved-By: Tom Tromey <tom@tromey.com>

Tom
  
Simon Marchi Feb. 26, 2025, 3:21 a.m. UTC | #2
On 2025-02-25 16:39, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:
> 
> Simon> Initialize fields of tu_stats to 0, remove the explicit default
> Simon> initialization of dwarf2_per_bfd::tu_stats.
> 
> Ok.
> Approved-By: Tom Tromey <tom@tromey.com>
> 
> Tom

Pushed, thanks.

Simon
  

Patch

diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h
index 0938dacc73c3..a7313a6e8ca9 100644
--- a/gdb/dwarf2/read.h
+++ b/gdb/dwarf2/read.h
@@ -38,12 +38,12 @@  extern struct cmd_list_element *show_dwarf_cmdlist;
 
 struct tu_stats
 {
-  int nr_uniq_abbrev_tables;
-  int nr_symtabs;
-  int nr_symtab_sharers;
-  int nr_stmt_less_type_units;
-  int nr_all_type_units_reallocs;
-  int nr_tus;
+  int nr_uniq_abbrev_tables = 0;
+  int nr_symtabs = 0;
+  int nr_symtab_sharers = 0;
+  int nr_stmt_less_type_units = 0;
+  int nr_all_type_units_reallocs = 0;
+  int nr_tus = 0;
 };
 
 struct dwarf2_cu;
@@ -529,7 +529,7 @@  struct dwarf2_per_bfd
 
   /* Type unit statistics, to see how well the scaling improvements
      are doing.  */
-  struct tu_stats tu_stats {};
+  struct tu_stats tu_stats;
 
   /* A table mapping DW_AT_dwo_name values to struct dwo_file objects.
      This is NULL if the table hasn't been allocated yet.  */