From patchwork Mon Apr 10 03:17:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 19930 Received: (qmail 75692 invoked by alias); 10 Apr 2017 03:17:35 -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 75668 invoked by uid 89); 10 Apr 2017 03:17:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=Hx-languages-length:1528, HCc:D*ca X-HELO: barracuda.ebox.ca Received: from barracuda.ebox.ca (HELO barracuda.ebox.ca) (96.127.255.19) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 10 Apr 2017 03:17:33 +0000 X-ASG-Debug-ID: 1491794251-0c856e65d41bf5840001-fS2M51 Received: from smtp.electronicbox.net (smtp.electronicbox.net [96.127.255.82]) by barracuda.ebox.ca with ESMTP id XcLqKryDqGaXV1BE (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 09 Apr 2017 23:17:32 -0400 (EDT) X-Barracuda-Envelope-From: simon.marchi@polymtl.ca X-Barracuda-RBL-Trusted-Forwarder: 96.127.255.82 Received: from simark.lan (173-246-11-162.qc.cable.ebox.net [173.246.11.162]) by smtp.electronicbox.net (Postfix) with ESMTP id E6F94440E7C; Sun, 9 Apr 2017 23:17:31 -0400 (EDT) From: Simon Marchi X-Barracuda-Effective-Source-IP: 173-246-11-162.qc.cable.ebox.net[173.246.11.162] X-Barracuda-Apparent-Source-IP: 173.246.11.162 X-Barracuda-RBL-IP: 173.246.11.162 To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH obv] windows-nat.c: Fix bad initialization of ptid Date: Sun, 9 Apr 2017 23:17:26 -0400 X-ASG-Orig-Subj: [PATCH obv] windows-nat.c: Fix bad initialization of ptid Message-Id: <20170410031726.2140-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 X-Barracuda-Connect: smtp.electronicbox.net[96.127.255.82] X-Barracuda-Start-Time: 1491794252 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://96.127.255.19:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 1570 X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=8.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.37951 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-IsSubscribed: yes FYI, I pushed this as obvious. When trying to build for x86_64-w64-mingw32: /home/simark/src/binutils-gdb/gdb/windows-nat.c: In function ‘void windows_detach(target_ops*, const char*, int)’: /home/simark/src/binutils-gdb/gdb/windows-nat.c:1915:20: error: converting to ‘ptid_t’ from initializer list would use explicit constructor ‘constexpr ptid_t::ptid_t(int, long int, long int)’ ptid_t ptid = {-1}; ^ Fixed by initializing ptid with the minus_one_ptid variable. gdb/ChangeLog: * windows-nat.c (windows_detach): Initialize ptid with minus_one_ptid. --- gdb/ChangeLog | 5 +++++ gdb/windows-nat.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 01c4c70b53..f08f5201d1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2017-04-09 Simon Marchi + + * windows-nat.c (windows_detach): Initialize ptid with + minus_one_ptid. + 2017-04-07 Simon Marchi * unittests/ptid-selftests.c: Fix erroneous assert messages. diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index ec0ae0691c..21b5ebefd8 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -1912,7 +1912,7 @@ windows_detach (struct target_ops *ops, const char *args, int from_tty) { int detached = 1; - ptid_t ptid = {-1}; + ptid_t ptid = minus_one_ptid; windows_resume (ops, ptid, 0, GDB_SIGNAL_0); if (!DebugActiveProcessStop (current_event.dwProcessId))