From patchwork Thu Dec 10 19:14:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antoine Tremblay X-Patchwork-Id: 9970 Received: (qmail 42520 invoked by alias); 10 Dec 2015 19:14:36 -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 42503 invoked by uid 89); 10 Dec 2015 19:14:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: usplmg20.ericsson.net Received: from usplmg20.ericsson.net (HELO usplmg20.ericsson.net) (198.24.6.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 10 Dec 2015 19:14:34 +0000 Received: from EUSAAHC008.ericsson.se (Unknown_Domain [147.117.188.96]) by usplmg20.ericsson.net (Symantec Mail Security) with SMTP id 0B.90.06940.79EC9665; Thu, 10 Dec 2015 20:12:23 +0100 (CET) Received: from elxa4wqvvz1.dyn.mo.ca.am.ericsson.se (147.117.188.8) by smtps-am.internal.ericsson.com (147.117.188.96) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 10 Dec 2015 14:14:31 -0500 From: Antoine Tremblay To: CC: Antoine Tremblay Subject: [PATCH] Fix regression revealed by corethreads.exp Date: Thu, 10 Dec 2015 14:14:26 -0500 Message-ID: <1449774866-18369-1-git-send-email-antoine.tremblay@ericsson.com> MIME-Version: 1.0 X-IsSubscribed: yes This patch fixes a regression introduced by: https://sourceware.org/ml/gdb-patches/2015-12/msg00192.html We can't use thread_from_lwp with core files. As mentioned in a comment, td_ta_map_lwp2thr uses ps_get_thread_area, but we can't use that currently on core targets, as it uses ptrace directly. Use directly record_thread instead. This fixes : PASS -> FAIL: gdb.threads/corethreads.exp: thread0 found PASS -> FAIL: gdb.threads/corethreads.exp: thread1 found gdb/ChangeLog: * linux-thread-db.c (find_new_threads_callback): Use record_thread. --- gdb/linux-thread-db.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index 8a80ca3..4e51c74 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -1226,7 +1226,7 @@ find_new_threads_callback (const td_thrhandle_t *th_p, void *data) ptid = ptid_build (info->pid, ti.ti_lid, 0); tp = find_thread_ptid (ptid); if (tp == NULL || tp->priv == NULL) - thread_from_lwp (ptid); + record_thread (info, tp, ptid, th_p, &ti); return 0; }