From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3717 invoked by alias); 26 Apr 2011 22:57:52 -0000 Received: (qmail 3709 invoked by uid 22791); 26 Apr 2011 22:57:52 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 26 Apr 2011 22:57:38 +0000 Received: from kpbe14.cbf.corp.google.com (kpbe14.cbf.corp.google.com [172.25.105.78]) by smtp-out.google.com with ESMTP id p3QMvaBL009312 for ; Tue, 26 Apr 2011 15:57:36 -0700 Received: from yxp4 (yxp4.prod.google.com [10.190.4.196]) by kpbe14.cbf.corp.google.com with ESMTP id p3QMvYMP005062 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Tue, 26 Apr 2011 15:57:35 -0700 Received: by yxp4 with SMTP id 4so250489yxp.10 for ; Tue, 26 Apr 2011 15:57:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.55.32 with SMTP id d32mr900159ana.42.1303858654496; Tue, 26 Apr 2011 15:57:34 -0700 (PDT) Received: by 10.100.131.8 with HTTP; Tue, 26 Apr 2011 15:57:34 -0700 (PDT) In-Reply-To: References: <20110426224430.D1BC8481B3@thebrac.mtv.corp.google.com> Date: Tue, 26 Apr 2011 23:09:00 -0000 Message-ID: Subject: Re: [patch] Add new -gmlt option for min. debug info with line tables (issue4440072) From: Cary Coutant To: Andrew Pinski Cc: reply@codereview.appspotmail.com, jason@redhat.com, gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-04/txt/msg02081.txt.bz2 >> This patch adds a new option, -gmlt, that produces level 1 debug info >> plus line number tables and inlined subroutine information. (The option >> is short for "minimum line tables," taken from a similar feature of >> HP's compilers.) > > What is the difference between -gmlt and -g1? =A0And why can't this just > be enabled for -g1? With -g1, you don't get line number tables or any inlined subroutine information. Here's the description of -g1 in the docs: "Level 1 produces minimal information, enough for making backtraces in parts of the program that you don't plan to debug. This includes descriptions of functions and external variables, but no information about local variables and no line numbers." I considered just changing -g1 to do this, with the argument that "enough for making backtraces" ought to include line numbers and inlined function calls, but I wasn't familiar enough with existing uses of -g1 to go with that alternative. I'm certainly willing to go that route, though, if that's preferable. If we do go with extending -g1, though. we want to be able to turn it on in our build scripts, yet allow a later "-g" option in the user's compiler options to enable full debug info. In this patch, I've made sure that "-gmlt -g" is equivalent to "-g2", whereas "-g1 -g" is the same as "-g1" by itself. (It's too much to train people to use "-g2" instead of "-g" when they want full debug.) -cary