This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 7/7] Windows has memory protection


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]