From patchwork Thu May 4 09:09:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Arnez X-Patchwork-Id: 20269 Received: (qmail 99395 invoked by alias); 4 May 2017 09:09:58 -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 98673 invoked by uid 89); 4 May 2017 09:09:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=H*o:Research X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 04 May 2017 09:09:56 +0000 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v448wcMt011024 for ; Thu, 4 May 2017 05:09:57 -0400 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 2a7tk20m0x-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 04 May 2017 05:09:57 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 4 May 2017 10:09:54 +0100 Received: from b06cxnps4076.portsmouth.uk.ibm.com (9.149.109.198) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 4 May 2017 10:09:52 +0100 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v4499quq38928452 for ; Thu, 4 May 2017 09:09:52 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 26AC14204C for ; Thu, 4 May 2017 10:08:31 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0A31042041 for ; Thu, 4 May 2017 10:08:31 +0100 (BST) Received: from oc1027705133.ibm.com (unknown [9.152.212.109]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS for ; Thu, 4 May 2017 10:08:30 +0100 (BST) From: Andreas Arnez To: gdb-patches@sourceware.org Subject: [PATCH obv] Remove some superfluous code in corelow.c Date: Thu, 04 May 2017 11:09:47 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 17050409-0016-0000-0000-0000049156F8 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17050409-0017-0000-0000-00002783B2DC Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-05-04_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1703280000 definitions=main-1705040150 X-IsSubscribed: yes Pushed this as obvious. In corelow.c I stumbled upon an extra semicolon and an xfree of a NULL pointer. Remove them. gdb/ChangeLog: * corelow.c (sniff_core_bfd): Remove extra semicolon. (get_core_register_section): Remove xfree of NULL pointer. --- gdb/ChangeLog | 5 +++++ gdb/corelow.c | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4e278f5..de4d90f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2017-05-04 Andreas Arnez + + * corelow.c (sniff_core_bfd): Remove extra semicolon. + (get_core_register_section): Remove xfree of NULL pointer. + 2017-05-03 Alan Hayward * frv-linux-tdep.c (frv_linux_supply_gregset): Use raw_supply_zeroed. diff --git a/gdb/corelow.c b/gdb/corelow.c index 3267c37..2266f24 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -129,7 +129,7 @@ sniff_core_bfd (bfd *abfd) { struct core_fns *cf; struct core_fns *yummy = NULL; - int matches = 0;; + int matches = 0; /* Don't sniff if we have support for register sets in CORE_GDBARCH. */ @@ -511,7 +511,7 @@ get_core_register_section (struct regcache *regcache, const char *human_name, int required) { - static char *section_name = NULL; + static char *section_name; struct bfd_section *section; bfd_size_type size; char *contents; @@ -519,8 +519,6 @@ get_core_register_section (struct regcache *regcache, && regset->flags & REGSET_VARIABLE_SIZE); ptid_t ptid = regcache_get_ptid (regcache); - xfree (section_name); - if (ptid_get_lwp (ptid)) section_name = xstrprintf ("%s/%ld", name, ptid_get_lwp (ptid));