This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 7/7] Windows has memory protection
- From: Yao Qi <yao at codesourcery dot com>
- To: <gdb-patches at sourceware dot org>
- Date: Fri, 20 Sep 2013 10:47:06 +0800
- Subject: [PATCH 7/7] Windows has memory protection
- Authentication-results: sourceware.org; auth=none
- References: <1378641807-24256-1-git-send-email-yao at codesourcery dot com> <1379645226-8719-1-git-send-email-yao at codesourcery dot com>
gdb:
2013-09-08 Yao Qi <yao@codesourcery.com>
* windows-tdep.c (windows_has_memory_protection): New function.
(windows_init_abi): Install windows_has_memory_protection to
gdbarch method 'has_memory_protection'.
---
gdb/windows-tdep.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c
index 50c5795..93d6fe6 100644
--- a/gdb/windows-tdep.c
+++ b/gdb/windows-tdep.c
@@ -481,6 +481,18 @@ init_w32_command_list (void)
}
}
+/* This is the implementation of gdbarch method has_memory_protection. */
+
+static int
+windows_has_memory_protection (struct gdbarch *gdbarch)
+{
+ /* Modern Windows has memory protection. However, some ancient
+ versions of Windows don't have full memory protection, such as
+ Windows 9x. If necessary, GDB should detect the version of
+ Windows and return false if the target OS is Windows 9x. */
+ return 1;
+}
+
/* To be called from the various GDB_OSABI_CYGWIN handlers for the
various Windows architectures and machine types. */
@@ -493,6 +505,9 @@ windows_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
set_gdbarch_iterate_over_objfiles_in_search_order
(gdbarch, windows_iterate_over_objfiles_in_search_order);
+
+ set_gdbarch_has_memory_protection (gdbarch,
+ windows_has_memory_protection);
}
/* Provide a prototype to silence -Wmissing-prototypes. */
--
1.7.7.6