From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17799 invoked by alias); 21 Dec 2007 21:57:34 -0000 Received: (qmail 17785 invoked by uid 22791); 21 Dec 2007 21:57:33 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 21 Dec 2007 21:57:28 +0000 Received: from zps76.corp.google.com (zps76.corp.google.com [172.25.146.76]) by smtp-out.google.com with ESMTP id lBLLvJru001475 for ; Fri, 21 Dec 2007 21:57:20 GMT Received: from wa-out-1112.google.com (wafk22.prod.google.com [10.114.187.22]) by zps76.corp.google.com with ESMTP id lBLLsrjE017518 for ; Fri, 21 Dec 2007 13:57:19 -0800 Received: by wa-out-1112.google.com with SMTP id k22so794991waf.18 for ; Fri, 21 Dec 2007 13:57:19 -0800 (PST) Received: by 10.115.106.7 with SMTP id i7mr1959706wam.18.1198274239053; Fri, 21 Dec 2007 13:57:19 -0800 (PST) Received: by 10.115.107.7 with HTTP; Fri, 21 Dec 2007 13:57:19 -0800 (PST) Message-ID: Date: Fri, 21 Dec 2007 21:57:00 -0000 From: "Doug Evans" To: gdb@sourceware.org Subject: use of python to pretty-print STL structures, etc. MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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: 2007-12/txt/msg00159.txt.bz2 Hi. Python scripting support will eventually be added to gdb. I'd like to better understand folks's views on if/how Python will help with one sore spot in gdb, namely the printing of c++ data structures in a way that is useful to the programmer, instead of the raw dump that is done today. e.g. instead of #include string s ("hello"); int main () { return 0; } (gdb) p s $1 = {static npos = 4294967295, _M_dataplus = {> = {<__gnu_cxx::new_allocator> = {}, }, _M_p = 0x9783014 "hello"}} and staring at the output to find what one wants, or doing "p s._M_dataplus._M_p", programmers would often rather just do something like "p s" and get "hello". Similarily for vectors, etc. As I understand it, and I'm sure you'll correct me if I'm wrong :-), the plan is to solve this problem with the new Python scripting support. I realize there's no real design as of yet (at least that I'm aware of), but my question is whether folks have thought about what it would look like from the command line. At a very basic level, do folks envision keeping the current cli u/i (*1) and enhancing it to provide python-providable extensions? Have folks thought about how they would like the above problem to be solved (with python or without)? --- (*1): One can replace the implementation as desired, it's the u/i I'm concerned with in this message.