From patchwork Fri Jul 20 16:29:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej W. Rozycki" X-Patchwork-Id: 28532 Received: (qmail 76720 invoked by alias); 20 Jul 2018 16:29:31 -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 76667 invoked by uid 89); 20 Jul 2018 16:29:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:966, H*r:0700 X-HELO: 9pmail.ess.barracuda.com Received: from 9pmail.ess.barracuda.com (HELO 9pmail.ess.barracuda.com) (64.235.154.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 20 Jul 2018 16:29:29 +0000 Received: from mipsdag02.mipstec.com (mail2.mips.com [12.201.5.32]) by mx1402.ess.rzc.cudaops.com (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=NO); Fri, 20 Jul 2018 16:29:26 +0000 Received: from [10.20.78.162] (10.20.78.162) by mipsdag02.mipstec.com (10.20.40.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1415.2; Fri, 20 Jul 2018 09:29:38 -0700 Date: Fri, 20 Jul 2018 17:29:19 +0100 From: "Maciej W. Rozycki" To: Subject: [committed] MIPS/Linux/native: Convert to `get_ptrace_pid' for PID extraction Message-ID: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Return-Path: macro@mips.com X-BESS-Apparent-Source-IP: 12.201.5.32 Use `get_ptrace_pid' to get the ptrace PID from `inferior_ptid' rather than extracting it by hand. gdb/ * mips-linux-nat.c (mips_linux_nat_target::read_description): Call `get_ptrace_pid' rather than extracting the ptrace PID by hand. --- gdb/mips-linux-nat.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) gdb-mips-linux-nat-get-ptrace-pid.diff Index: binutils/gdb/mips-linux-nat.c =================================================================== --- binutils.orig/gdb/mips-linux-nat.c 2018-07-09 18:07:06.852666718 +0100 +++ binutils/gdb/mips-linux-nat.c 2018-07-20 00:30:12.473106296 +0100 @@ -458,11 +458,7 @@ mips_linux_nat_target::read_description if (have_dsp < 0) { - int tid; - - tid = inferior_ptid.lwp (); - if (tid == 0) - tid = inferior_ptid.pid (); + int tid = get_ptrace_pid (inferior_ptid); errno = 0; ptrace (PTRACE_PEEKUSER, tid, DSP_CONTROL, 0);