From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4451 invoked by alias); 31 Aug 2004 16:07:59 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 4430 invoked from network); 31 Aug 2004 16:07:57 -0000 Received: from unknown (HELO foon.sendmail.com) (209.246.26.40) by sourceware.org with SMTP; 31 Aug 2004 16:07:57 -0000 Received: from [10.210.112.140] ([10.210.112.140]) (authenticated bits=0) by foon.sendmail.com (Switch-3.1.6/Switch-3.1.6) with ESMTP id i7VG7tEC000378 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=OK); Tue, 31 Aug 2004 09:07:55 -0700 Message-ID: <4134A25C.4020700@sendmail.com> Date: Tue, 31 Aug 2004 16:07:00 -0000 From: Chris Markle User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.2) Gecko/20040803 MIME-Version: 1.0 To: Michael Chastain CC: gdb@sources.redhat.com Subject: Re: calling glibc mallinfo() from GDB after attaching to a process? References: <4133DDC2.3040403@sendmail.com> <01c48f0e$Blat.v2.2.2$c9e5a100@zahav.net.il> <41340BA3.6020801@sendmail.com> <4134975D.nailH9511JUUH@mindspring.com> In-Reply-To: <4134975D.nailH9511JUUH@mindspring.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-08/txt/msg00439.txt.bz2 Michael, Thanks mucho for your excellent reply... > That way, you're calling a function in your program instead of > a shared library, and the function returns an int rather than > a struct. Both of these things make gdb work better, and avoid > errors like this: > > (gdb) print mallinfo() > > Program received signal SIGSEGV, Segmentation fault. > 0x4207512d in mallinfo () from /lib/i686/libc.so.6 > The program being debugged was signaled while in a function called from GDB. > GDB remains in the frame where the signal was received. > To change this behavior use "set unwindonsignal on" > Evaluation of the expression containing the function (mallinfo) will be abandoned. I am getting exactly this seg fault when calling mallinfo(). Do later versions of gdb deal better with this? Chris