From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17144 invoked by alias); 8 Sep 2013 12:05:00 -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 17073 invoked by uid 89); 8 Sep 2013 12:04:59 -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:59 +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 1VIdjb-0005Rz-FU from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Sun, 08 Sep 2013 05:04:55 -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:55 -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:53 -0700 From: Yao Qi To: Subject: [PATCH 2/7] set trust-readonly-sections off in test cases Date: Sun, 08 Sep 2013 12:05:00 -0000 Message-ID: <1378641807-24256-3-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/msg00261.txt.bz2 In the test cases, if GDB modified code in the inferior, it should 'set trust-readonly-sections off'. gdb/testsuite: 2013-09-08 Yao Qi * gdb.base/break-always.exp: Set trust-readonly-sections off. * gdb.mi/mi-fill-memory.exp: Likewise. --- gdb/testsuite/gdb.base/break-always.exp | 4 ++++ gdb/testsuite/gdb.mi/mi-fill-memory.exp | 5 +++++ 2 files changed, 9 insertions(+), 0 deletions(-) diff --git a/gdb/testsuite/gdb.base/break-always.exp b/gdb/testsuite/gdb.base/break-always.exp index b0a9faf..16f6d47 100644 --- a/gdb/testsuite/gdb.base/break-always.exp +++ b/gdb/testsuite/gdb.base/break-always.exp @@ -69,6 +69,10 @@ gdb_test "p /x \$shadow = *(char *) $bp_address" \ # and still leave the breakpoint insn planted. Try twice with # different values, in case we happen to be writting exactly what was # there already. +# Turn option "trust-readonly-sections" off to force GDB to read +# contents from the target instead of the object file. +gdb_test_no_output "set trust-readonly-sections off" + gdb_test "p /x *(char *) $bp_address = 0" \ " = 0x0" \ "write 0 to breakpoint's address" diff --git a/gdb/testsuite/gdb.mi/mi-fill-memory.exp b/gdb/testsuite/gdb.mi/mi-fill-memory.exp index 5f68cbb..2b7408a 100644 --- a/gdb/testsuite/gdb.mi/mi-fill-memory.exp +++ b/gdb/testsuite/gdb.mi/mi-fill-memory.exp @@ -35,6 +35,11 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}.c" "${binfile}" executable {d mi_run_to_main mi_next_to "main" "" "mi-read-memory.c" "20" "next at main" +# Turn option "trust-readonly-sections" off to force GDB to read +# contents from the target instead of the object file. +mi_gdb_test "-gdb-set trust-readonly-sections off" "\\\^done" \ + "set trust-readonly-sections off" + mi_gdb_test "1-data-write-memory-bytes"\ "1\\\^error,msg=\"Usage: ADDR DATA \\\[COUNT\\\]\.\""\ "no arguments" -- 1.7.7.6