From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11191 invoked by alias); 22 Jun 2010 00:29:11 -0000 Received: (qmail 11177 invoked by uid 22791); 22 Jun 2010 00:29:10 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-pw0-f41.google.com (HELO mail-pw0-f41.google.com) (209.85.160.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 22 Jun 2010 00:29:05 +0000 Received: by pwi7 with SMTP id 7so4543298pwi.0 for ; Mon, 21 Jun 2010 17:29:04 -0700 (PDT) Received: by 10.114.242.11 with SMTP id p11mr4732126wah.83.1277166544009; Mon, 21 Jun 2010 17:29:04 -0700 (PDT) Received: from [172.16.147.175] ([60.12.143.18]) by mx.google.com with ESMTPS id f11sm21759155wai.11.2010.06.21.17.29.01 (version=SSLv3 cipher=RC4-MD5); Mon, 21 Jun 2010 17:29:03 -0700 (PDT) Message-ID: <4C2003E8.3000407@gmail.com> Date: Tue, 22 Jun 2010 00:29:00 -0000 From: asmwarrior User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.10) Gecko/20100512 Thunderbird/3.0.5 MIME-Version: 1.0 To: tromey@redhat.com CC: gdb@sourceware.org Subject: Re: About the "info locals" command of gdb and python pretty printer References: <4C1DDBB0.9010202@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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-06/txt/msg00091.txt.bz2 On 2010-6-22 4:08, Tom Tromey wrote: > >>> At this time, if we run the "info locals" with python stl pretty >>> printer enabled, as you see, if you breakpoint is still at the first >>> line "int aaa = 1;", then bbbb and cccc are not initialized, this may >>> cause the python script to plot random values, some times, gdb or >>> python will get crashed. >>> > I think the real problem here is that gdb crashed. That should not > happen. Can you find out what went wrong? > > Python exceptions are "normal" in the sense that they should not cause > gdb any problems. > > We should fix the problem that exceptions during pretty-printing can > cause problems. I think there are a few parts to this. We > should differentiate the different types of gdb exception in Python, so > that things like memory errors can cause nicer behavior. We should also > make lazy strings truly lazy during printing. This will eliminate some > problems when trying to print a lazy string with length==-1. > > Tom > Hi, Tom, thanks for your reply. I also noticed your reply in http://sourceware.org/bugzilla/show_bug.cgi?id=11407#c34 As you said, GDB should be robust, so that even it has some exceptions from python. (Or python script will call internally some gdb command, at that time, gdb has some exception too). I'm not sure how to get a "stack track" when gdb crashed. Do I need to run GDB under GDB. So, the debuggee GDB get crashed, the debugger GDB can generate some stack trace inforamtion? Thanks Asmwarrior