From patchwork Mon Oct 10 18:54:20 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Weigand X-Patchwork-Id: 4602 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 428A423EF7 for ; Mon, 10 Oct 2011 18:54:25 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id 06AA4A1821D for ; Mon, 10 Oct 2011 18:54:24 +0000 (UTC) Received: by mail-yw0-f52.google.com with SMTP id 31so8725835ywp.11 for ; Mon, 10 Oct 2011 11:54:24 -0700 (PDT) Received: by 10.223.92.144 with SMTP id r16mr34047732fam.23.1318272864414; Mon, 10 Oct 2011 11:54:24 -0700 (PDT) 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.152.24.41 with SMTP id r9cs129579laf; Mon, 10 Oct 2011 11:54:24 -0700 (PDT) Received: by 10.227.170.68 with SMTP id c4mr1862011wbz.62.1318272863054; Mon, 10 Oct 2011 11:54:23 -0700 (PDT) Received: from mtagate7.uk.ibm.com (mtagate7.uk.ibm.com. [194.196.100.167]) by mx.google.com with ESMTPS id ft3si14318533wbb.59.2011.10.10.11.54.22 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 10 Oct 2011 11:54:22 -0700 (PDT) Received-SPF: pass (google.com: domain of uweigand@de.ibm.com designates 194.196.100.167 as permitted sender) client-ip=194.196.100.167; Authentication-Results: mx.google.com; spf=pass (google.com: domain of uweigand@de.ibm.com designates 194.196.100.167 as permitted sender) smtp.mail=uweigand@de.ibm.com Received: from d06nrmr1507.portsmouth.uk.ibm.com (d06nrmr1507.portsmouth.uk.ibm.com [9.149.38.233]) by mtagate7.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p9AIsMs1018191 for ; Mon, 10 Oct 2011 18:54:22 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1507.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p9AIsMEV2384018 for ; Mon, 10 Oct 2011 19:54:22 +0100 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 p9AIsLrA014817 for ; Mon, 10 Oct 2011 12:54:21 -0600 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 p9AIsKg8014775 for ; Mon, 10 Oct 2011 12:54:20 -0600 Message-Id: <201110101854.p9AIsKg8014775@d06av02.portsmouth.uk.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Mon, 10 Oct 2011 20:54:20 +0200 Subject: [commit, arm] Fix PR gdb/13218 (GDB segfaults on 3.x kernels) To: patches@linaro.org Date: Mon, 10 Oct 2011 20:54:20 +0200 (CEST) From: "Ulrich Weigand" X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 http://sourceware.org/ml/gdb-patches/2011-10/msg00283.html ChangeLog: PR gdb/13218 * arm-linux-nat.c (os_version, os_major, os_minor, os_release): Remove unused variables. (get_linux_version): Remove function. (_initialize_arm_linux_nat): Do not call it. Index: gdb/arm-linux-nat.c =================================================================== RCS file: /cvs/src/src/gdb/arm-linux-nat.c,v retrieving revision 1.49 diff -u -p -r1.49 arm-linux-nat.c --- gdb/arm-linux-nat.c 7 Oct 2011 17:15:15 -0000 1.49 +++ gdb/arm-linux-nat.c 10 Oct 2011 18:36:53 -0000 @@ -72,22 +72,6 @@ static int arm_linux_vfp_register_count; extern int arm_apcs_32; -/* The following variables are used to determine the version of the - underlying GNU/Linux operating system. Examples: - - GNU/Linux 2.0.35 GNU/Linux 2.2.12 - os_version = 0x00020023 os_version = 0x0002020c - os_major = 2 os_major = 2 - os_minor = 0 os_minor = 2 - os_release = 35 os_release = 12 - - Note: os_version = (os_major << 16) | (os_minor << 8) | os_release - - These are initialized using get_linux_version() from - _initialize_arm_linux_nat(). */ - -static unsigned int os_version, os_major, os_minor, os_release; - /* On GNU/Linux, threads are implemented as pseudo-processes, in which case we may be tracing more than one process at a time. In that case, inferior_ptid will contain the main process ID and the @@ -644,31 +628,6 @@ ps_get_thread_area (const struct ps_proc return PS_OK; } -static unsigned int -get_linux_version (unsigned int *vmajor, - unsigned int *vminor, - unsigned int *vrelease) -{ - struct utsname info; - char *pmajor, *pminor, *prelease, *tail; - - if (-1 == uname (&info)) - { - warning (_("Unable to determine GNU/Linux version.")); - return -1; - } - - pmajor = strtok (info.release, "."); - pminor = strtok (NULL, "."); - prelease = strtok (NULL, "."); - - *vmajor = (unsigned int) strtoul (pmajor, &tail, 0); - *vminor = (unsigned int) strtoul (pminor, &tail, 0); - *vrelease = (unsigned int) strtoul (prelease, &tail, 0); - - return ((*vmajor << 16) | (*vminor << 8) | *vrelease); -} - static const struct target_desc * arm_linux_read_description (struct target_ops *ops) { @@ -1287,8 +1246,6 @@ _initialize_arm_linux_nat (void) { struct target_ops *t; - os_version = get_linux_version (&os_major, &os_minor, &os_release); - /* Fill in the generic GNU/Linux methods. */ t = linux_target ();