From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19109 invoked by alias); 8 Sep 2013 12:05:15 -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 19075 invoked by uid 89); 8 Sep 2013 12:05:14 -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; Sun, 08 Sep 2013 12:05:14 +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-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1VIdjr-0005Wr-3S from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Sun, 08 Sep 2013 05:05:11 -0700 Received: from SVR-ORW-FEM-02.mgc.mentorg.com ([147.34.96.206]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Sun, 8 Sep 2013 05:05:11 -0700 Received: from qiyao.dyndns.org.dyndns.org (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.2.247.3; Sun, 8 Sep 2013 05:05:09 -0700 From: Yao Qi To: Subject: [PATCH 7/7] Windows has memory protection Date: Sun, 08 Sep 2013 12:05:00 -0000 Message-ID: <1378641807-24256-8-git-send-email-yao@codesourcery.com> In-Reply-To: <1378641807-24256-1-git-send-email-yao@codesourcery.com> References: <1378432920-7731-1-git-send-email-yao@codesourcery.com> <1378641807-24256-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2013-09/txt/msg00265.txt.bz2 gdb: 2013-09-08 Yao Qi * 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