From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16140 invoked by alias); 13 Aug 2010 23:02:47 -0000 Received: (qmail 16054 invoked by uid 48); 13 Aug 2010 23:02:47 -0000 Date: Fri, 13 Aug 2010 23:02:00 -0000 From: "joachim dot protze at zih dot tu-dresden dot de" To: gdb-prs@sourceware.org Message-ID: <20100813230246.11915.joachim.protze@zih.tu-dresden.de> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug python/11915] New: API for casting pointer to array[length] X-Bugzilla-Reason: CC Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2010-q3/txt/msg00206.txt.bz2 It would be nice, to have a python api mechanism to print a pointer as array of specific length. (gdb) python print gdb.parse_and_eval("(int[3]*)buf").type int (*)[3] (gdb) python print gdb.parse_and_eval("(int[3]*)buf").dereference() {0, 1, 2} It is possible to cast the pointer to array with the python cast function: (gdb) python print gdb.parse_and_eval("buf").cast(gdb.parse_and_eval("(int[3]*) buf").type).type int (*)[3] The pointer is successfully printed as array[length]: (gdb) python print gdb.parse_and_eval("buf").cast(gdb.parse_and_eval("(int[3]*) buf").type).dereference() {0, 1, 2} But there is no way to create the array type with python like: gdb.lookup_type("int").array(3).pointer() or: gdb.lookup_type("int[3]").pointer() -- Summary: API for casting pointer to array[length] Product: gdb Version: 7.2 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: python AssignedTo: unassigned at sourceware dot org ReportedBy: joachim dot protze at zih dot tu-dresden dot de CC: gdb-prs at sourceware dot org http://sourceware.org/bugzilla/show_bug.cgi?id=11915 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.