From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7463 invoked by alias); 13 Oct 2009 19:16:30 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 7448 invoked by uid 22791); 13 Oct 2009 19:16:29 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Date: Tue, 13 Oct 2009 19:16:00 -0000 From: Daniel Jacobowitz To: archer@sourceware.org Subject: Some Python bugs Message-ID: <20091013191623.GA19876@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-SW-Source: 2009-q4/txt/msg00008.txt.bz2 I recently wrote a Python script to search through debug info and generate some XML data I needed. Here's a few issues I noticed (from memory, please excuse typos): * The Python bindings do not expose array bounds. I had to use sizeof to determine the size and assume the array was zero-indexed (which is C-specific). * Calling type.fields on an array type crashes. It accesses TYPE_N_BASECLASSES; cplus_stuff isn't allocated for non-structs. * The archer branch calls PyGILState_Ensure in several places where it should call ensure_python_env. So python_language was often unset if I tried 'gdb -ex "source -p file.py"'. To work around it, I had the end of file.py register a new gdb.Command, and called the command. * There's no way to get at macro definitions (e.g. info macro). Also, GDB doesn't offer a list of all macros defined... I had to use "complete print " and pass them all to info macro. * It would be really useful to temporarily redirect GDB output to a memory buffer, i.e. a version of gdb.execute that captured the command's output. Especially where there aren't specific Python bindings for what I wanted. -- Daniel Jacobowitz CodeSourcery