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 3/3] Linux has memory protection.


gdb:

2013-09-06  Yao Qi  <yao@codesourcery.com>

	* linux-tdep.c (linux_has_memory_protection): New function.
	(linux_init_abi): Register linux_has_memory_protection
	to gdbarch 'has_memory_protection'.
---
 gdb/linux-tdep.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c
index eb8ea2b..36e7119 100644
--- a/gdb/linux-tdep.c
+++ b/gdb/linux-tdep.c
@@ -259,6 +259,15 @@ linux_has_shared_address_space (struct gdbarch *gdbarch)
   return linux_is_uclinux ();
 }
 
+/* This is the implementation of gdbarch method has_memory_protection.  */
+
+static int
+linux_has_memory_protection (struct gdbarch *gdbarch)
+{
+  /* Normal linux has memory protection, while uClinux doesn't.  */
+  return !linux_is_uclinux ();
+}
+
 /* This is how we want PTIDs from core files to be printed.  */
 
 static char *
@@ -1783,6 +1792,7 @@ linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 				      linux_gdb_signal_from_target);
   set_gdbarch_gdb_signal_to_target (gdbarch,
 				    linux_gdb_signal_to_target);
+  set_gdbarch_has_memory_protection (gdbarch, linux_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]