From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19756 invoked by alias); 18 Sep 2009 09:29:58 -0000 Received: (qmail 19743 invoked by uid 22791); 18 Sep 2009 09:29:56 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from lo.gmane.org (HELO lo.gmane.org) (80.91.229.12) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 18 Sep 2009 09:29:51 +0000 Received: from list by lo.gmane.org with local (Exim 4.50) id 1MoZmm-00039d-BZ for gdb-patches@sources.redhat.com; Fri, 18 Sep 2009 11:29:48 +0200 Received: from h86-62-88-129.ln.rinet.ru ([86.62.88.129]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 18 Sep 2009 11:29:48 +0200 Received: from vladimir by h86-62-88-129.ln.rinet.ru with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 18 Sep 2009 11:29:48 +0200 To: gdb-patches@sources.redhat.com From: Vladimir Prus Subject: Re: Patch: implement new dynamic varobj spec Date: Fri, 18 Sep 2009 09:29:00 -0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit User-Agent: KNode/0.10.9 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: 2009-09/txt/msg00581.txt.bz2 Tom Tromey wrote: > This is the long-awaited dynamic varobj patch. > It implements the spec as described by Vladimir: > > http://sourceware.org/ml/gdb/2009-07/msg00088.html > > .. with various minor changes we've discussed on that thread and > elsewhere. I didn't give the follow-up URLs; I think that the doc patch > ought to be sufficient, and if it isn't, I will fix it up. > > This has been in development for quite a while, including testing using > two different MI consumers (Vladimir's and one by Noam Yorav-Raphael). > > There are three outstanding bugs. > > * A dynamic varobj bug that I couldn't reproduce > http://sourceware.org/ml/archer/2009-q3/msg00169.html I've got with gdb-inside-gdb. What happens is: - we have uninitialized std::vector (did I already say that gcc produces bogus debug info?) - The 'strings' at the address where supposed storage of the bogus vector is point nowhere. - When Python code tries to pretty-print inaccassible memory, it gives: Traceback (most recent call last): File "/home/ghost/Build/python/libstdcxx/v6/printers.py", line 469, in to_string return self.val['_M_dataplus']['_M_p'].string (encoding, length = len) RuntimeError: Cannot access memory at address 0xcf - Inside GDB, pretty_print_one_value catches the above exception, and returns 0. - The rest of GDB fallbacks to printing the value as it would without Python pretty-printing. And with 'set print pretty 1', it pretty-prints the raw value. I think there are two things worth fixing: 1. set print pretty 1 should have no effect on MI. I can handle this part. 2. pretty-printer for string should catch exception and return "" or some such. Alternatively, GDB should not fallback to regular display if Python pretty-printer fails. Yet alternatively, GDB should distinguish between different failure modes of Python pretty-printer, since memory access error likely to be caused by uninitalized data and should not cause fallback. Does this make any sense? - Volodya