From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24768 invoked by alias); 20 Sep 2011 16:05:19 -0000 Received: (qmail 24756 invoked by uid 22791); 20 Sep 2011 16:05:16 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from ausc60pc101.us.dell.com (HELO ausc60pc101.us.dell.com) (143.166.85.206) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 20 Sep 2011 16:05:02 +0000 X-Loopcount0: from 10.170.28.39 From: To: Date: Tue, 20 Sep 2011 16:05:00 -0000 Subject: Python: should gdb.Value array indexing check bounds? Message-ID: <09787EF419216C41A903FD14EE5506DD03094C6D5D@AUSX7MCPC103.AMER.DELL.COM> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-09/txt/msg00069.txt.bz2 Currently, if a gdb.Value object corresponds to an array, array indexing is= done C-style: no bounds checking, just pointer arithmetic.=A0 That's somew= hat unnatural to Python.=A0 Should it do a range check instead, and raise I= ndexError for out of range index values? That wouldn't affect indexing of pointers, since those don't have a range s= o the only possible approach is the C one. =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 paul=20