aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2009-05-24 20:55:33 +0000
committerDoug Evans <dje@google.com>2009-05-24 20:55:33 +0000
commit4e3990f4f91f2c3b0dd64fa80ce4662151763323 (patch)
treea292210366793d28af01849ae6e1f83a5423c6dc /gdb
parent98b54c187e1f56d5b7397e36c6d88551ff75699f (diff)
downloadgdb-4e3990f4f91f2c3b0dd64fa80ce4662151763323.zip
gdb-4e3990f4f91f2c3b0dd64fa80ce4662151763323.tar.gz
gdb-4e3990f4f91f2c3b0dd64fa80ce4662151763323.tar.bz2
* infrun.c (follow_fork): Initialize new step_* locals
to avoid "may be used uninitialized" warnings.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/infrun.c12
2 files changed, 11 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index cd8671b..a61114c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2009-05-24 Doug Evans <dje@google.com>
+
+ * infrun.c (follow_fork): Initialize new step_* locals
+ to avoid "may be used uninitialized" warnings.
+
2009-05-24 Pedro Alves <pedro@codesourcery.com>
* inflow.c (copy_terminal_info): Deep copy `run_terminal'.
diff --git a/gdb/infrun.c b/gdb/infrun.c
index f9b34dd..bfca0b5 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -290,12 +290,12 @@ follow_fork (void)
/* Copy user stepping state to the new inferior thread. FIXME: the
followed fork child thread should have a copy of most of the
- parent thread structure's run control related fields, not just
- these. */
- struct breakpoint *step_resume_breakpoint;
- CORE_ADDR step_range_start;
- CORE_ADDR step_range_end;
- struct frame_id step_frame_id;
+ parent thread structure's run control related fields, not just these.
+ Initialized to avoid "may be used uninitialized" warnings from gcc. */
+ struct breakpoint *step_resume_breakpoint = NULL;
+ CORE_ADDR step_range_start = 0;
+ CORE_ADDR step_range_end = 0;
+ struct frame_id step_frame_id = { 0 };
if (!non_stop)
{