From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16641 invoked by alias); 8 Sep 2013 12:04:56 -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 16627 invoked by uid 89); 8 Sep 2013 12:04:55 -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:04:55 +0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,FROM_12LTRDOM,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 1VIdjW-0005Rj-Fp from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Sun, 08 Sep 2013 05:04:50 -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:04:50 -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:04:49 -0700 From: Yao Qi To: Subject: [PATCH 0/7 V2] Trust readonly sections if target has memory protection Date: Sun, 08 Sep 2013 12:04:00 -0000 Message-ID: <1378641807-24256-1-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/msg00258.txt.bz2 Here is the V2, to address comments to V1, - Warn about writes to readonly sections if trust-readonly-sections is enabled. (patch 1/7) - Windows targets have memory protection. (patch 7/7) Do some refactor in Windows related targets, add a new function windows_init_abi (done by patch 3/7). It paves the way for patch 7/7. Below the description of this series in V1: https://sourceware.org/ml/gdb-patches/2013-09/msg00193.html When option "trust-readonly-sections" was introduced in this patch http://www.sourceware.org/ml/gdb-patches/2002-01/msg00711.html, there was the discussion to turn it on in default. However, we didn't do that because we have a concern that bad or buggy program may modify the code on the non-memory protected system. On the other hand, it is highly recommended to turn this on in remote debugging. I am wondering if we can teach GDB to trust read-only sections if it knows the target system has memory protection. For some targets, such as linux, we know they do have memory protection. This is what this patch series tries to do. This change improves GDB's out-of-box performance. I wrote a micro-benchmark to disassemble GDB in GDB in remote debugging (native-gdbserver) on x86-linux, and collect the time usage and the number of 'm' packets, /wo patch /w patch time usage : 0.44s 0.10 number of 'm' : 43157 4 As we can see, the number of RSP 'm' packet is reduced dramatically, and the time usage is reduced to some extent. In my experiment, GDBserver is running natively, so connection speed is quite fast. In some slow connections, the improvement will be more. *** BLURB HERE *** Yao Qi (7): Emit a warning when writing to a readonly section and trust_readonly is true set trust-readonly-sections off in test cases New function windows_init_abi Trust readonly sections if target has memory protection DOC and NEWS Linux has memory protection. Windows has memory protection gdb/NEWS | 5 ++ gdb/amd64-windows-tdep.c | 5 +- gdb/arch-utils.c | 7 +++ gdb/arch-utils.h | 2 + gdb/doc/gdb.texinfo | 11 ++++- gdb/gdbarch.c | 24 ++++++++++++ gdb/gdbarch.h | 6 +++ gdb/gdbarch.sh | 3 + gdb/i386-cygwin-tdep.c | 9 +--- gdb/linux-tdep.c | 10 +++++ gdb/target.c | 62 ++++++++++++++++++++++-------- gdb/testsuite/gdb.base/break-always.exp | 4 ++ gdb/testsuite/gdb.mi/mi-fill-memory.exp | 5 ++ gdb/windows-tdep.c | 31 +++++++++++++++- gdb/windows-tdep.h | 6 +-- 15 files changed, 156 insertions(+), 34 deletions(-) -- 1.7.7.6