From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17596 invoked by alias); 1 Oct 2011 10:23:06 -0000 Received: (qmail 17588 invoked by uid 22791); 1 Oct 2011 10:23:05 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 01 Oct 2011 10:22:51 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1R9wiY-0001Ak-AW from pedro_alves@mentor.com ; Sat, 01 Oct 2011 03:22:50 -0700 Received: from scottsdale.localnet ([172.16.63.104]) by EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Sat, 1 Oct 2011 11:22:48 +0100 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: Python: fetch value when building gdb.Value object Date: Sat, 01 Oct 2011 10:23:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-11-generic; KDE/4.7.1; x86_64; ; ) Cc: Jan Kratochvil , Phil Muldoon , Paul Koning References: <36B29E9D-F2B3-446F-AF8A-97254A3AAEE2@comcast.net> <20111001092852.GB11227@host1.jankratochvil.net> In-Reply-To: <20111001092852.GB11227@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201110011122.46865.pedro@codesourcery.com> X-IsSubscribed: yes 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 X-SW-Source: 2011-10/txt/msg00008.txt.bz2 On Saturday 01 October 2011 10:28:52, Jan Kratochvil wrote: > # Test memory error. > gdb_test "python print gdb.parse_and_eval('*(int*)0')" "gdb.MemoryError: Cannot access memory at address 0x0.*" > + gdb_test "python inval = gdb.parse_and_eval('*(int*)0')" "gdb.MemoryError: Cannot access memory at address 0x0.*" I see this is already the case, but just a reminder that this will fail (or rather the write will succeed) on targets without an MMU. We should skip it with something like: set can_read_zero 0 gdb_test_multiple "x 0" "memory at address 0" { -re "0x0:.*Cannot access memory at address 0x0.*$gdb_prompt $" { } -re "0x0:.*Error accessing memory address 0x0.*$gdb_prompt $" { } -re ".*$gdb_prompt $" { set can_read_zero 1 } } if { !$can_read_zero } { gdb_test "python print gdb.parse_and_eval('*(int*)0')" "gdb.MemoryError: Cannot access memory at address 0x0.*" gdb_test "python inval = gdb.parse_and_eval('*(int*)0')" "gdb.MemoryError: Cannot access memory at address 0x0.*" } -- Pedro Alves