From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5154 invoked by alias); 26 Aug 2010 12:25:45 -0000 Received: (qmail 5120 invoked by uid 22791); 26 Aug 2010 12:25:44 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp.nokia.com (HELO mgw-mx09.nokia.com) (192.100.105.134) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 26 Aug 2010 12:25:38 +0000 Received: from vaebh106.NOE.Nokia.com (vaebh106.europe.nokia.com [10.160.244.32]) by mgw-mx09.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o7QCPIai022445 for ; Thu, 26 Aug 2010 07:25:36 -0500 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by vaebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 26 Aug 2010 15:25:26 +0300 Received: from mgw-da02.ext.nokia.com ([147.243.128.26]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 26 Aug 2010 15:25:25 +0300 Received: from gar.localnet (berwst16747.europe.nokia.com [172.25.167.47]) by mgw-da02.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id o7QCPNZB019112 for ; Thu, 26 Aug 2010 15:25:24 +0300 From: =?iso-8859-15?q?Andr=E9_P=F6nitz?= To: gdb@sourceware.org Subject: Re: gdb breaking down at printing variable Date: Thu, 26 Aug 2010 12:25:00 -0000 User-Agent: KMail/1.13.2 (Linux/2.6.32-21-generic; KDE/4.4.2; i686; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201008261425.21062.andre.poenitz@nokia.com> X-Nokia-AV: Clean 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: 2010-08/txt/msg00153.txt.bz2 On Thursday 26 August 2010 13:41:29 ext Vikas Mishra wrote: > Hello Folks, > > I am new to C++ but have used gdb in the past. I am using the python > pretty print extensions to the GDB to print STL containers. I wanted > to check with the mailing list about an issue that I was seeing > recently. I am seeing the issue both on Cygwin as well as in Linux. > > Problem : Unable to print a vector during debugging. > > How to reproduce it : I have attached a program which has two > functions - main and split, It is a very simple program that takes a > string and splits it into words (like Perl's split function). I am not > able to print the variable "ret" anywhere in the "split" function. This is most likely http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44731 i.e. not gdb's fault. > What is observed : Error seen is "virtual memory exahusted: can't > allocate xxxx bytes". > > If I try to print "list_of_words" anywhere in the main function, it is > behaving as expected. This a consequence of above (gdb trying to read data from a wrong location, triggered by the faulty debug information) but I am pretty sure it can be triggered independently by uninitialized or corrupted data in the "real" vector object containing the same "noise". You should be able to verify that by creating such an object and purposely corrupt it by overwriting it with the data you currently get with, say, p {char[12]}&ret. Andre'