public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Add initializers to tracepoint
@ 2022-05-06 18:11 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2022-05-06 18:11 UTC (permalink / raw)
  To: gdb-cvs

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

commit b68f26dea78f1a390084a0e2bfa95f1bcf1942dc
Author: Tom Tromey <tom@tromey.com>
Date:   Sun May 1 21:02:01 2022 -0600

    Add initializers to tracepoint
    
    This adds some initializers to tracepoint.  I think right now these
    may not be needed, due to obscure rules about zero initialization.
    However, this will change in the next patch, and anyway it is clearer
    to be explicit.

Diff:
---
 gdb/breakpoint.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index 356af45accd..d244e8daec0 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -987,18 +987,18 @@ struct tracepoint : public breakpoint
 
   /* Number of times this tracepoint should single-step and collect
      additional data.  */
-  long step_count;
+  long step_count = 0;
 
   /* Number of times this tracepoint should be hit before
      disabling/ending.  */
-  int pass_count;
+  int pass_count = 0;
 
   /* The number of the tracepoint on the target.  */
-  int number_on_target;
+  int number_on_target = 0;
 
   /* The total space taken by all the trace frames for this
      tracepoint.  */
-  ULONGEST traceframe_usage;
+  ULONGEST traceframe_usage = 0;
 
   /* The static tracepoint marker id, if known.  */
   std::string static_trace_marker_id;
@@ -1009,7 +1009,7 @@ struct tracepoint : public breakpoint
      the array of markers we found for the given marker ID for which
      this static tracepoint corresponds.  When resetting breakpoints,
      we will use this index to try to find the same marker again.  */
-  int static_trace_marker_id_idx;
+  int static_trace_marker_id_idx = 0;
 };


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

only message in thread, other threads:[~2022-05-06 18:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-06 18:11 [binutils-gdb] Add initializers to tracepoint Tom Tromey

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).