From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13951 invoked by alias); 16 Apr 2009 17:06:21 -0000 Received: (qmail 13880 invoked by uid 22791); 16 Apr 2009 17:06:19 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 16 Apr 2009 17:06:14 +0000 Received: from mailhost3.vmware.com (mailhost3.vmware.com [10.16.27.45]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id B98AC36006; Thu, 16 Apr 2009 10:06:10 -0700 (PDT) Received: from [10.20.94.141] (msnyder-server.eng.vmware.com [10.20.94.141]) by mailhost3.vmware.com (Postfix) with ESMTP id AE5E1C9A61; Thu, 16 Apr 2009 10:06:10 -0700 (PDT) Message-ID: <49E76456.80907@vmware.com> Date: Fri, 17 Apr 2009 07:59:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: Lennyk CC: "gdb@sourceware.org" Subject: Re: Core dump information when code is optimized References: <49E6D676.9000108@gmail.com> In-Reply-To: <49E6D676.9000108@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 2009-04/txt/msg00139.txt.bz2 Lennyk wrote: > Hi, > > When I compile only with -O1 flag - my core dump information does not > show line number or offset (when a segmentation fault has occurred). > Only when I add the -g flag does the core dump contain line number > information - but the executable's size grows significantly! > > Is there a way to get this information with core dump - but maintain the > optimized sized executable? It is -g that matters, not -O. -g generates line info. This info goes into your executable, but it does not increase your memory footprint -- only the size of the file. In other words this line info is not copied into memory at runtime. Which means that it also does not appear in the corefile, so your corefile should not get significantly bigger.