From patchwork Thu Apr 12 16:49:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 26693 Received: (qmail 20969 invoked by alias); 12 Apr 2018 16:49:52 -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 20958 invoked by uid 89); 12 Apr 2018 16:49:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.3 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Apr 2018 16:49:51 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BA6958DC32 for ; Thu, 12 Apr 2018 16:49:49 +0000 (UTC) Received: from localhost.localdomain (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 60C3610B00B2 for ; Thu, 12 Apr 2018 16:49:49 +0000 (UTC) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [pushed/ob] Fix Solaris build Date: Thu, 12 Apr 2018 17:49:48 +0100 Message-Id: <20180412164948.25873-1-palves@redhat.com> MIME-Version: 1.0 This commit fixes a bit of rot in procfs.c caused by recent changes. Specifically, the target_ops::to_detach change to pass down 'inferior *' missed updating a forward declation, and the change to use scoped_fd in more places missed removing one do_cleanups call. src/gdb/procfs.c: In function ‘target_ops* procfs_target()’: src/gdb/procfs.c:167:16: error: invalid conversion from ‘void (*)(target_ops*, const char*, int)’ to ‘void (*)(target_ops*, inferior*, int)’ [-fpermissive] t->to_detach = procfs_detach; ^ src/gdb/procfs.c: In function ‘ssd* proc_get_LDT_entry(procinfo*, int)’: src/gdb/procfs.c:1624:17: error: ‘old_chain’ was not declared in this scope do_cleanups (old_chain); ^ src/gdb/procfs.c: At global scope: src/gdb/procfs.c:90:13: error: ‘void procfs_detach(target_ops*, const char*, int)’ declared ‘static’ but never defined [-Werror=unused-function] static void procfs_detach (struct target_ops *, const char *, int); ^ src/gdb/procfs.c:1923:1: error: ‘void procfs_detach(target_ops*, inferior*, int)’ defined but not used [-Werror=unused-function] procfs_detach (struct target_ops *ops, inferior *inf, int from_tty) ^ gdb/ChangeLog: 2018-04-12 Pedro Alves * procfs.c (procfs_detach): Make forward declaration's prototype match definition's protototype. (proc_get_LDT_entry): Remove stale do_cleanups call. --- gdb/ChangeLog | 6 ++++++ gdb/procfs.c | 7 ++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a05520fb7c..66ca520aad 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2018-04-12 Pedro Alves + + * procfs.c (procfs_detach): Make forward declaration's prototype + match definition's protototype. + (proc_get_LDT_entry): Remove stale do_cleanups call. + 2018-04-12 Pedro Alves * target.h (target_ops::to_has_exited): Delete. diff --git a/gdb/procfs.c b/gdb/procfs.c index 5ca7477fa5..3c747cd3e2 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -87,7 +87,7 @@ /* This module defines the GDB target vector and its methods. */ static void procfs_attach (struct target_ops *, const char *, int); -static void procfs_detach (struct target_ops *, const char *, int); +static void procfs_detach (struct target_ops *, inferior *, int); static void procfs_resume (struct target_ops *, ptid_t, int, enum gdb_signal); static void procfs_files_info (struct target_ops *); @@ -1620,10 +1620,7 @@ proc_get_LDT_entry (procinfo *pi, int key) break; /* end of table */ /* If key matches, return this entry. */ if (ldt_entry->sel == key) - { - do_cleanups (old_chain); - return ldt_entry; - } + return ldt_entry; } /* Loop ended, match not found. */ return NULL;