From patchwork Tue Jun 11 11:38:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 33083 Received: (qmail 55970 invoked by alias); 11 Jun 2019 11:38:09 -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 55957 invoked by uid 89); 11 Jun 2019 11:38:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=showed, H*Ad:D*fr, HContent-Transfer-Encoding:8bit X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 11 Jun 2019 11:38:07 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id DA9CF5602E; Tue, 11 Jun 2019 07:38:05 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id X2h9LxnsuhTF; Tue, 11 Jun 2019 07:38:05 -0400 (EDT) Received: from murgatroyd.Home (174-29-48-168.hlrn.qwest.net [174.29.48.168]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 846C55602D; Tue, 11 Jun 2019 07:38:05 -0400 (EDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [FYI] Remove shadowing from darwin-nat.c Date: Tue, 11 Jun 2019 05:38:02 -0600 Message-Id: <20190611113802.3932-1-tromey@adacore.com> MIME-Version: 1.0 From: Tom Tromey Building on Darwin with gcc showed that darwin-nat.c had some shadowing variable declarations. This removes them. gdb/ChangeLog 2019-06-11 Tom Tromey * darwin-nat.c (darwin_decode_exception_message) (darwin_decode_message, darwin_nat_target::kill): Fix shadowing. --- gdb/ChangeLog | 5 +++++ gdb/darwin-nat.c | 12 +++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c index 8282ef27e61..d2cb683c572 100644 --- a/gdb/darwin-nat.c +++ b/gdb/darwin-nat.c @@ -687,7 +687,6 @@ darwin_decode_exception_message (mach_msg_header_t *hdr, /* Not a known inferior. This could happen if the child fork, as the created process will inherit its exception port. FIXME: should the exception port be restored ? */ - kern_return_t kret; mig_reply_error_t reply; inferior_debug @@ -1125,14 +1124,14 @@ darwin_decode_message (mach_msg_header_t *hdr, if (!priv->no_ptrace) { - pid_t res; + pid_t res_pid; int wstatus; - res = wait4 (inf->pid, &wstatus, 0, NULL); - if (res < 0 || res != inf->pid) + res_pid = wait4 (inf->pid, &wstatus, 0, NULL); + if (res_pid < 0 || res_pid != inf->pid) { printf_unfiltered (_("wait4: res=%d: %s\n"), - res, safe_strerror (errno)); + res_pid, safe_strerror (errno)); status->kind = TARGET_WAITKIND_IGNORE; return minus_one_ptid; } @@ -1148,7 +1147,7 @@ darwin_decode_message (mach_msg_header_t *hdr, } inferior_debug (4, _("darwin_wait: pid=%d exit, status=0x%x\n"), - res, wstatus); + res_pid, wstatus); /* Looks necessary on Leopard and harmless... */ wait4 (inf->pid, &wstatus, 0, NULL); @@ -1559,7 +1558,6 @@ darwin_nat_target::kill () signaled thus darwin_decode_message function knows that the kill signal was sent by gdb and will take the appropriate action (cancel signal and reply to the signal message). */ - darwin_inferior *priv = get_darwin_inferior (inf); for (darwin_thread_t *thread : priv->threads) thread->signaled = 1;