From patchwork Wed Dec 21 21:25:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Weigand X-Patchwork-Id: 5936 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 3054923E0E for ; Wed, 21 Dec 2011 21:26:05 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id 1B14DA1852C for ; Wed, 21 Dec 2011 21:26:05 +0000 (UTC) Received: by eaac11 with SMTP id c11so5084720eaa.11 for ; Wed, 21 Dec 2011 13:26:05 -0800 (PST) Received: by 10.205.138.136 with SMTP id is8mr2484555bkc.35.1324502764835; Wed, 21 Dec 2011 13:26:04 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.205.82.144 with SMTP id ac16cs50306bkc; Wed, 21 Dec 2011 13:26:04 -0800 (PST) Received: by 10.227.207.205 with SMTP id fz13mr7916065wbb.0.1324502763165; Wed, 21 Dec 2011 13:26:03 -0800 (PST) Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com. [195.75.94.108]) by mx.google.com with ESMTPS id cr8si15417568wib.12.2011.12.21.13.26.02 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Dec 2011 13:26:03 -0800 (PST) Received-SPF: pass (google.com: domain of uweigand@de.ibm.com designates 195.75.94.108 as permitted sender) client-ip=195.75.94.108; Authentication-Results: mx.google.com; spf=pass (google.com: domain of uweigand@de.ibm.com designates 195.75.94.108 as permitted sender) smtp.mail=uweigand@de.ibm.com Received: from /spool/local by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 21 Dec 2011 21:26:02 -0000 Received: from d06nrmr1307.portsmouth.uk.ibm.com ([9.149.38.129]) by e06smtp12.uk.ibm.com ([192.168.101.142]) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 21 Dec 2011 21:26:00 -0000 Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1307.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pBLLPxRV2588696 for ; Wed, 21 Dec 2011 21:25:59 GMT Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pBLLPx6n029033 for ; Wed, 21 Dec 2011 14:25:59 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id pBLLPwQa029028; Wed, 21 Dec 2011 14:25:58 -0700 Message-Id: <201112212125.pBLLPwQa029028@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Wed, 21 Dec 2011 22:25:58 +0100 Subject: [commit+7.4][arm/bfd] Fill in core_pid to fix GDB corethreads.exp failures To: gdb-patches@sourceware.org, binutils@sourceware.org Date: Wed, 21 Dec 2011 22:25:58 +0100 (CET) From: "Ulrich Weigand" Cc: patches@linaro.org X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 x-cbid: 11122121-8372-0000-0000-0000012E070A Hello, I've noticed another couple of additional test suite failures in GDB 7.4: FAIL: gdb.threads/corethreads.exp: thread0 found FAIL: gdb.threads/corethreads.exp: thread1 found These test verify that GDB shows proper pthread_t thread IDs for core files. This works only if bfd_core_file_pid returns the correct PID, which only works if the ->core_pid field is filled in by target code. This has been added on a number of platforms, but not ARM so far. The (obvious) patch below fixes this by filling in this field in elf32_arm_nabi_grok_psinfo. Tested on arm-linux-gnueabi, fixes the above test cases. Committed to mainline and (GDB) 7.4 branch. Bye, Ulrich ChangeLog: bfd/ * elf32-arm.c (elf32_arm_nabi_grok_psinfo): Fill in core_pid. Index: bfd/elf32-arm.c =================================================================== RCS file: /cvs/src/src/bfd/elf32-arm.c,v retrieving revision 1.281 diff -u -p -r1.281 elf32-arm.c --- bfd/elf32-arm.c 17 Nov 2011 00:20:01 -0000 1.281 +++ bfd/elf32-arm.c 21 Dec 2011 20:18:30 -0000 @@ -1966,6 +1966,8 @@ elf32_arm_nabi_grok_psinfo (bfd *abfd, E return FALSE; case 124: /* Linux/ARM elf_prpsinfo. */ + elf_tdata (abfd)->core_pid + = bfd_get_32 (abfd, note->descdata + 12); elf_tdata (abfd)->core_program = _bfd_elfcore_strndup (abfd, note->descdata + 28, 16); elf_tdata (abfd)->core_command