This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 6/7] Linux 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:05 +0800
- Subject: [PATCH 6/7] Linux 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>
* 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