From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21560 invoked by alias); 6 Sep 2013 02:03:11 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 21502 invoked by uid 89); 6 Sep 2013 02:03:10 -0000 Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Sep 2013 02:03:10 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RDNS_NONE,SPF_HELO_FAIL autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1VHlO6-0006po-31 from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Thu, 05 Sep 2013 19:03:06 -0700 Received: from SVR-ORW-FEM-03.mgc.mentorg.com ([147.34.97.39]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 5 Sep 2013 19:03:05 -0700 Received: from qiyao.dyndns.org.dyndns.org (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.2.247.3; Thu, 5 Sep 2013 19:03:04 -0700 From: Yao Qi To: Subject: [PATCH 3/3] Linux has memory protection. Date: Fri, 06 Sep 2013 02:03:00 -0000 Message-ID: <1378432920-7731-4-git-send-email-yao@codesourcery.com> In-Reply-To: <1378432920-7731-1-git-send-email-yao@codesourcery.com> References: <1378432920-7731-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2013-09/txt/msg00196.txt.bz2 gdb: 2013-09-06 Yao Qi * 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