Fix GDB build when using GCC 4.1.2
Commit Message
A recent gdb change has broken my ability to build gdb with GCC 4.1.2. It
dies with:
/scratch/sellcey/repos/gdb/src/gdb/gdb/remote.c: In function 'remote_newthread_step':
/scratch/sellcey/repos/gdb/src/gdb/gdb/remote.c:2844: warning: 'item.name' is used uninitialized in this function
make[1]: *** [remote.o] Error 1
I am not seeing this error with newer GCC versions that I build with so it
may be a GCC bug but I would like to change gdb so I can still build with
GCC 4.1.2. The fix is to simply initialize item.name in the locations where
item.extra is already being initialized. This allows me to build gdb.
OK to checkin?
Steve Ellcey
sellcey@imgtec.com
2015-12-01 Steve Ellcey <sellcey@imgtec.com>
* remote.c (remote_newthread_step): Initialize item.name.
(remote_get_threads_with_qthreadinfo): Ditto.
Comments
"Steve Ellcey " <sellcey@imgtec.com> writes:
> OK to checkin?
>
Yes, patch is OK to me.
On Wed, 2015-12-02 at 08:47 +0000, Yao Qi wrote:
> "Steve Ellcey " <sellcey@imgtec.com> writes:
>
> > OK to checkin?
> >
>
> Yes, patch is OK to me.
>
It looks like Ulrich already took care of this. gdb is building for me
with the changes he checked in.
Steve Ellcey
sellcey@imgtec.com
@@ -2904,6 +2904,7 @@ remote_newthread_step (threadref *ref, void *data)
item.ptid = ptid_build (pid, threadref_to_int (ref), 0);
item.core = -1;
item.extra = NULL;
+ item.name = NULL;
VEC_safe_push (thread_item_t, context->items, &item);
@@ -3069,6 +3070,7 @@ remote_get_threads_with_qthreadinfo (struct target_ops *ops,
item.ptid = read_ptid (bufp, &bufp);
item.core = -1;
item.extra = NULL;
+ item.name = NULL;
VEC_safe_push (thread_item_t, context->items, &item);
}