aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2020-04-08 14:33:35 -0600
committerTom Tromey <tromey@adacore.com>2020-04-08 14:47:57 -0600
commit62fe396b1cba6b0c3d06b758d9f8254c6d538ad8 (patch)
treeafd1d84fb940cab90ad9dc2affc968e82762b35d /gdb
parente9534bd257ac9ea2f7921e8000d27c5dc4477b4e (diff)
downloadgdb-62fe396b1cba6b0c3d06b758d9f8254c6d538ad8.zip
gdb-62fe396b1cba6b0c3d06b758d9f8254c6d538ad8.tar.gz
gdb-62fe396b1cba6b0c3d06b758d9f8254c6d538ad8.tar.bz2
Change two windows_thread_info members to "bool"
This changes a couple of fields of windows_thread_info to have type "bool". It also updates the comment of another field, to clarify the possible values it can hold. gdb/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * windows-nat.c (thread_rec) (windows_nat_target::fetch_registers): Update. * nat/windows-nat.h (struct windows_thread_info) <suspended>: Update comment. <debug_registers_changed, reload_context>: Now bool. gdbserver/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * win32-i386-low.c (update_debug_registers) (i386_prepare_to_resume, i386_thread_added): Update.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/nat/windows-nat.h9
-rw-r--r--gdb/windows-nat.c4
3 files changed, 16 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f0b1f33..6fce48c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,13 @@
2020-04-08 Tom Tromey <tromey@adacore.com>
+ * windows-nat.c (thread_rec)
+ (windows_nat_target::fetch_registers): Update.
+ * nat/windows-nat.h (struct windows_thread_info) <suspended>:
+ Update comment.
+ <debug_registers_changed, reload_context>: Now bool.
+
+2020-04-08 Tom Tromey <tromey@adacore.com>
+
* windows-nat.c (windows_add_thread): Use new.
(windows_init_thread_list, windows_delete_thread): Use delete.
(get_windows_debug_event): Update.
diff --git a/gdb/nat/windows-nat.h b/gdb/nat/windows-nat.h
index a3da268..27fd7ed 100644
--- a/gdb/nat/windows-nat.h
+++ b/gdb/nat/windows-nat.h
@@ -48,7 +48,10 @@ struct windows_thread_info
/* Thread Information Block address. */
CORE_ADDR thread_local_base;
- /* Non zero if SuspendThread was called on this thread. */
+ /* This keeps track of whether SuspendThread was called on this
+ thread. -1 means there was a failure or that the thread was
+ explicitly not suspended, 1 means it was called, and 0 means it
+ was not. */
int suspended = 0;
#ifdef _WIN32_WCE
@@ -67,11 +70,11 @@ struct windows_thread_info
/* Whether debug registers changed since we last set CONTEXT back to
the thread. */
- int debug_registers_changed = 0;
+ bool debug_registers_changed = false;
/* Nonzero if CONTEXT is invalidated and must be re-read from the
inferior thread. */
- int reload_context = 0;
+ bool reload_context = false;
/* The name of the thread, allocated by xmalloc. */
char *name = nullptr;
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 715cf60..b7f21cb 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -439,7 +439,7 @@ thread_rec (DWORD id, int get_context)
}
else if (get_context < 0)
th->suspended = -1;
- th->reload_context = 1;
+ th->reload_context = true;
}
return th;
}
@@ -695,7 +695,7 @@ windows_nat_target::fetch_registers (struct regcache *regcache, int r)
dr[7] = th->context.Dr7;
}
}
- th->reload_context = 0;
+ th->reload_context = false;
}
if (r < 0)