This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 3/4] windows-nat: Consistently use numeric get_context parameter to thread_rec()
- From: Jon Turney <jon dot turney at dronecode dot org dot uk>
- To: gdb-patches at sourceware dot org
- Cc: Jon Turney <jon dot turney at dronecode dot org dot uk>
- Date: Wed, 3 Jun 2015 18:29:51 +0100
- Subject: [PATCH 3/4] windows-nat: Consistently use numeric get_context parameter to thread_rec()
- Authentication-results: sourceware.org; auth=none
- References: <1433352592-9728-1-git-send-email-jon dot turney at dronecode dot org dot uk>
thread_rec()'s get_context parameter is not a bool, and has the following
meanings
>0 suspend, retrieve context
0 use already retrieved context
<0 already suspended, retrieve context
Consistently use numeric values throughout windows-nat.c, rather than a mixture
of numeric and bool values.
gdb/ChangeLog:
2015-06-03 Jon Turney <jon.turney@dronecode.org.uk>
* windows-nat.c : Consistently use numeric get_context parameter
to thread_rec() throughout.
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
---
gdb/ChangeLog | 5 +++++
gdb/windows-nat.c | 12 ++++++------
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d170f7c..996dffe 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2015-06-03 Jon Turney <jon.turney@dronecode.org.uk>
+ * windows-nat.c : Consistently use numeric get_context parameter
+ to thread_rec() throughout.
+
+2015-06-03 Jon Turney <jon.turney@dronecode.org.uk>
+
* windows-nat.c (do_windows_fetch_inferior_registers)
(handle_output_debug_string): Replace __COPY_CONTEXT_SIZE
conditional with __CYGWIN__.
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 9d2e3c2..ce1513f 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -341,7 +341,7 @@ windows_add_thread (ptid_t ptid, HANDLE h, void *tlb)
id = ptid_get_tid (ptid);
- if ((th = thread_rec (id, FALSE)))
+ if ((th = thread_rec (id, 0)))
return th;
th = XCNEW (windows_thread_info);
@@ -496,7 +496,7 @@ static void
windows_fetch_inferior_registers (struct target_ops *ops,
struct regcache *regcache, int r)
{
- current_thread = thread_rec (ptid_get_tid (inferior_ptid), TRUE);
+ current_thread = thread_rec (ptid_get_tid (inferior_ptid), 1);
/* Check if current_thread exists. Windows sometimes uses a non-existent
thread id in its events. */
if (current_thread)
@@ -523,7 +523,7 @@ static void
windows_store_inferior_registers (struct target_ops *ops,
struct regcache *regcache, int r)
{
- current_thread = thread_rec (ptid_get_tid (inferior_ptid), TRUE);
+ current_thread = thread_rec (ptid_get_tid (inferior_ptid), 1);
/* Check if current_thread exists. Windows sometimes uses a non-existent
thread id in its events. */
if (current_thread)
@@ -1252,7 +1252,7 @@ windows_resume (struct target_ops *ops,
ptid_get_pid (ptid), ptid_get_tid (ptid), step, sig));
/* Get context for currently selected thread. */
- th = thread_rec (ptid_get_tid (inferior_ptid), FALSE);
+ th = thread_rec (ptid_get_tid (inferior_ptid), 0);
if (th)
{
if (step)
@@ -1513,7 +1513,7 @@ get_windows_debug_event (struct target_ops *ops,
thread_id);
current_thread = th;
if (!current_thread)
- current_thread = thread_rec (thread_id, TRUE);
+ current_thread = thread_rec (thread_id, 1);
}
out:
@@ -2667,7 +2667,7 @@ windows_thread_alive (struct target_ops *ops, ptid_t ptid)
gdb_assert (ptid_get_tid (ptid) != 0);
tid = ptid_get_tid (ptid);
- return WaitForSingleObject (thread_rec (tid, FALSE)->h, 0) == WAIT_OBJECT_0
+ return WaitForSingleObject (thread_rec (tid, 0)->h, 0) == WAIT_OBJECT_0
? FALSE : TRUE;
}
--
2.1.4