From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22228 invoked by alias); 8 Feb 2012 16:36:10 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 22078 invoked by uid 22791); 8 Feb 2012 16:36:08 -0000 X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org To: archer@sourceware.org From: Vladimir Subject: Re: pretty printing of smart pointers and making function calls Date: Wed, 08 Feb 2012 16:36:00 -0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit User-Agent: Loom/3.14 (http://gmane.org/) X-SW-Source: 2012-q1/txt/msg00007.txt.bz2 Hi, > You can work around this a little by having the base printer also print > the pointed-to value. This is what the libstdc++ iterator printers do > (for now). I'm not sure I understand you correctly. Do you mean that if the user asks for a value of variable a and pretty printer knows that it's a pointer then along with pointer address it should print the value the pointer points too? Anyway some reference to document or example would be useful here. > Yes, it can be done. What you have to do is get the address of the > function as a value. There's no super way to do this right now: > > http://sourceware.org/bugzilla/show_bug.cgi?id=12027 The link above mentions gdb.parse_and_eval() which does exactly what I need. > However, you usually don't want to call functions when pretty-printing. > For one thing, this means core-file debugging won't work. > It is better, when possible, to do everything in Python instead. But you are right that this doesn't work with core-file. Is there any way to check in Python whether I debug alive process or see its dead body? Thanks, Vladimir