From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19825 invoked by alias); 10 Mar 2010 03:38:21 -0000 Received: (qmail 19816 invoked by uid 22791); 10 Mar 2010 03:38:20 -0000 X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from outbound.icp-qv1-irony-out3.iinet.net.au (HELO outbound.icp-qv1-irony-out3.iinet.net.au) (203.59.1.148) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 10 Mar 2010 03:38:16 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAPGilkvLzoJq/2dsb2JhbACbBXO8B4R5BA Received: from unknown (HELO corb.contemporary.net.au) ([203.206.130.106]) by outbound.icp-qv1-irony-out3.iinet.net.au with ESMTP; 10 Mar 2010 11:38:12 +0800 Received: from [10.10.10.192] (utzon.contemporary.net.au [10.10.10.192]) by corb.contemporary.net.au (8.13.8/8.13.8) with ESMTP id o2A3cATI007822 for ; Wed, 10 Mar 2010 14:38:11 +1100 Message-ID: <4B971421.8080006@contemporary.net.au> Date: Wed, 10 Mar 2010 03:38:00 -0000 From: Chris Johns User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 MIME-Version: 1.0 To: gdb@sourceware.org Subject: Reading a static variable in Python Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 2010-03/txt/msg00060.txt.bz2 Hello, I am adding pretty printers for RTEMS to gdb. In the RTEMS operating system elements such as a semaphore are given an id. I would like to print the actual semaphore data given a semaphore id. To do this I need to read a kernel structure from a table indexed via a bit field in the id. As an example the semaphore's table is declared in RTEMS as: RTEMS_SEM_EXTERN Objects_Information _Semaphore_Information; How would I read the 10 element of the _Semaphore_Information in Python ? I am stuck on how to create a new gdb.Value variable in Python. Thanks Chris