From patchwork Tue Dec 1 17:08:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ulrich Weigand X-Patchwork-Id: 9854 Received: (qmail 30525 invoked by alias); 1 Dec 2015 17:08:48 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 30515 invoked by uid 89); 1 Dec 2015 17:08:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e06smtp07.uk.ibm.com Received: from e06smtp07.uk.ibm.com (HELO e06smtp07.uk.ibm.com) (195.75.94.103) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Tue, 01 Dec 2015 17:08:46 +0000 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 1 Dec 2015 17:08:42 -0000 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 1 Dec 2015 17:08:39 -0000 X-IBM-Helo: d06dlp03.portsmouth.uk.ibm.com X-IBM-MailFrom: uweigand@de.ibm.com X-IBM-RcptTo: gdb-patches@sourceware.org Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id A6B9F1B08070 for ; Tue, 1 Dec 2015 17:09:04 +0000 (GMT) Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tB1H8cJG62521424 for ; Tue, 1 Dec 2015 17:08:38 GMT Received: from d06av08.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id tB1H8cjH011851 for ; Tue, 1 Dec 2015 10:08:38 -0700 Received: from oc7340732750.ibm.com (dyn-9-152-213-152.boeblingen.de.ibm.com [9.152.213.152]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id tB1H8c2Z011834; Tue, 1 Dec 2015 10:08:38 -0700 Received: by oc7340732750.ibm.com (Postfix, from userid 500) id DC954F8BD; Tue, 1 Dec 2015 18:08:37 +0100 (CET) Subject: [commit] Fix build error (Re: [PATCH v2 2/3] Display names of remote threads) To: simon.marchi@ericsson.com (Simon Marchi) Date: Tue, 1 Dec 2015 18:08:37 +0100 (CET) From: "Ulrich Weigand" Cc: palves@redhat.com (Pedro Alves), gdb-patches@sourceware.org In-Reply-To: <56572AA0.9070904@ericsson.com> from "Simon Marchi" at Nov 26, 2015 10:52:00 AM MIME-Version: 1.0 Message-Id: <20151201170837.DC954F8BD@oc7340732750.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15120117-0029-0000-0000-0000050544B8 Simon Marchi wrote: > (thread_item_t) : New field. This causes build errors for me when using a GCC 4.4.7 host compiler: gdb/remote.c: In function ‘remote_update_thread_list’: gdb/remote.c:2855: error: ‘item.name’ may be used uninitialized in this function gdb/remote.c:3079: note: ‘item.name’ was declared here There were in fact two places where a struct thread_item with an uninitialized name field was added to a vector. I've checked in the following patch to fix the build error. Bye, Ulrich ChangeLog: * remote.c (remote_newthread_step): Initialize item.name. (remote_get_threads_with_qthreadinfo): Likewise. diff --git a/gdb/remote.c b/gdb/remote.c index 9d44ce1..c60f173 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -2914,6 +2914,7 @@ remote_newthread_step (threadref *ref, void *data) item.ptid = ptid_build (pid, threadref_to_int (ref), 0); item.core = -1; + item.name = NULL; item.extra = NULL; VEC_safe_push (thread_item_t, context->items, &item); @@ -3079,6 +3080,7 @@ remote_get_threads_with_qthreadinfo (struct target_ops *ops, item.ptid = read_ptid (bufp, &bufp); item.core = -1; + item.name = NULL; item.extra = NULL; VEC_safe_push (thread_item_t, context->items, &item);