From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 536 invoked by alias); 6 Jan 2014 19:02:41 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 524 invoked by uid 89); 6 Jan 2014 19:02:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 06 Jan 2014 19:02:39 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s06J2cs3002520 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 6 Jan 2014 14:02:38 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s06J2bwm017582; Mon, 6 Jan 2014 14:02:37 -0500 Message-ID: <52CAFDCD.7070000@redhat.com> Date: Mon, 06 Jan 2014 19:02:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Tom Tromey CC: gdb-patches@sourceware.org Subject: Re: [PATCH 0/3] main_name cleanups References: <1389028297-16977-1-git-send-email-tromey@redhat.com> In-Reply-To: <1389028297-16977-1-git-send-email-tromey@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-01/txt/msg00083.txt.bz2 On 01/06/2014 05:11 PM, Tom Tromey wrote: > This series cleans up the "main_name" code both for multi-inferior and > for the long-running objfile splitting project. > > Currently, the name and language of main are globals. Also, they can > set in a couple of spots in the debuginfo readers. > > Their global-ness can, I think, affect multi-inferior operation. Definitely. > If > you have two inferiors that have different main names, then I think > perhaps some unwinding scenario could fail, because main_name will > necessarily be incorrect for one of them, and because inside_main_func > checks this value. The fix here is to make the determination > per-progspace. Sounds right to me. I was just wondering why duplicate the main name/language both in the progspace and in the objfiles? Wouldn't just storing a pointer to the objfile that has the main name and its language in the progspace be enough? If not, then it'd be good to mention that in a comment, I think. > Setting them in the debuginfo readers is bad because, once debuginfo > sharing happens, the second progspace to use the debuginfo will not > pick up the main name automatically. The fix here is to record the > debuginfo readers' findings in the per-BFD object. > > Let me know what you think. -- Pedro Alves