This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] windows-nat.c: Fix bad initialization of ptid
- From: Simon Marchi <simark at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 10 Apr 2017 03:16:17 -0000
- Subject: [binutils-gdb] windows-nat.c: Fix bad initialization of ptid
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=8473b4472dce9ce87aaad35ff8e975e1487f914e
commit 8473b4472dce9ce87aaad35ff8e975e1487f914e
Author: Simon Marchi <simon.marchi@polymtl.ca>
Date: Sun Apr 9 23:14:36 2017 -0400
windows-nat.c: Fix bad initialization of ptid
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.
Diff:
---
gdb/ChangeLog | 5 +++++
gdb/windows-nat.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 01c4c70..f08f520 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2017-04-09 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * windows-nat.c (windows_detach): Initialize ptid with
+ minus_one_ptid.
+
2017-04-07 Simon Marchi <simon.marchi@ericsson.com>
* unittests/ptid-selftests.c: Fix erroneous assert messages.
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index ec0ae06..21b5ebe 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))