From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11107 invoked by alias); 7 Mar 2012 11:28:37 -0000 Received: (qmail 11092 invoked by uid 22791); 7 Mar 2012 11:28:36 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_LOW,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-qy0-f169.google.com (HELO mail-qy0-f169.google.com) (209.85.216.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Mar 2012 11:28:18 +0000 Received: by qcsd16 with SMTP id d16so3575882qcs.0 for ; Wed, 07 Mar 2012 03:28:18 -0800 (PST) Received: by 10.224.116.18 with SMTP id k18mr860683qaq.14.1331119697897; Wed, 07 Mar 2012 03:28:17 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.116.18 with SMTP id k18mr860654qaq.14.1331119697525; Wed, 07 Mar 2012 03:28:17 -0800 (PST) Received: by 10.224.54.80 with HTTP; Wed, 7 Mar 2012 03:28:17 -0800 (PST) Date: Wed, 07 Mar 2012 11:28:00 -0000 Message-ID: Subject: [patch 0/2] New 'explore' command From: Siva Chandra To: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-System-Of-Record: true X-Gm-Message-State: ALoCoQnlasEKw6t0ImirDq/OVoiAbpqsW2Gn13+QLDjHaklV/MbqSMomJaO0eSIY8dvPkZwhoCbQ11RSd02qKo+mT7d4UYmqm4Ton1AjXl9sIQdy5co/XL2WdYcXOU2VRwJyyVTeSqn5G5kcZ8XZhtPjFEnsrzgYnA== 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: 2012-03/txt/msg00215.txt.bz2 Hi all, I had, in a different thread, sent different patches for a new 'explore' command implemented in C as well as in Python using the GDB Python API (see for ref http://sourceware.org/ml/gdb-patches/2012-02/msg00099.html). There were a couple of comments about preferring a Python implementation over a C implementation. However, I have preferred a C implementation for two reasons: 1. I want this to be available to all GDB builds and not limited to those built with Python enabled, 2. I could not find a way to get the 'target' type of a C++ reference value using the Python API. I am probably missing something here. Whatever the case, if the community prefers a Python implementation, then so be it. I will be sending both implementations as different patches (with docs) in this series. I apologize if this amounts to being spam! To help recollect, sample runs of the 'explore' command are as follows: Example of value exploration: ======================== (gdb) explore cs The value of 'cs' is of type 'struct ComplexStruct' with the following fields: s = u = sa = Enter the field number of choice: 2 'cs.sa' is an array of elements of type 'SS'. Enter the index you want to explore in 'cs.sa': 1 The value of '(cs.sa)[1]' is of type 'SS' which is a typedef of type 'struct SimpleStruct'. The value of '(cs.sa)[1]' is of type 'struct SimpleStruct' with the following fields: a = 1 .. (Value of type 'int') d = 11.1 .. (Value of type 'double') Press enter to return to parent value: Returning to parent value... 'cs.sa' is an array of elements of type 'SS'. Enter the index you want to explore in 'cs.sa': Returning to parent value... The value of 'cs' is of type 'struct ComplexStruct' with the following fields: s = u = sa = Enter the field number of choice: (gdb) Example of type exploration: ======================== (gdb) explore struct SimpleStruct 'struct SimpleStruct' has the following fields: a = d = Enter the field number of choice: 1 field 'd' of 'struct SimpleStruct' is of a scalar type 'double'. Press enter to return to enclosing type: Returning to parent type... 'struct SimpleStruct' has the following fields: a = d = Enter the field number of choice: (gdb) Thanks, Siva Chandra