From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15452 invoked by alias); 18 Feb 2003 17:31:10 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 15432 invoked from network); 18 Feb 2003 17:31:08 -0000 Received: from unknown (HELO touchme.toronto.redhat.com) (172.16.49.200) by 172.16.49.205 with SMTP; 18 Feb 2003 17:31:08 -0000 Received: from redhat.com (toocool.toronto.redhat.com [172.16.14.72]) by touchme.toronto.redhat.com (Postfix) with ESMTP id 0A48080008E; Tue, 18 Feb 2003 12:31:08 -0500 (EST) Message-ID: <3E526DDB.3050402@redhat.com> Date: Tue, 18 Feb 2003 17:31:00 -0000 From: "J. Johnston" Organization: Red Hat Inc. User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Mark Kettenis Cc: Daniel Jacobowitz , gdb-patches@sources.redhat.com Subject: Re: RFA: Patch for corefile support References: <3E35BB3A.2020003@redhat.com> <86bs1wp24l.fsf@elgar.kettenis.dyndns.org> <20030201170042.GB29615@nevyn.them.org> <3E3EF40B.4020305@redhat.com> <20030203233859.GA28591@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-02/txt/msg00374.txt.bz2 Daniel Jacobowitz wrote: > On Mon, Feb 03, 2003 at 05:58:19PM -0500, J. Johnston wrote: > >> >>Daniel Jacobowitz wrote: >> >>>On Sat, Feb 01, 2003 at 02:22:02PM +0100, Mark Kettenis wrote: >>> >>> >>>>"J. Johnston" writes: >>>> >>>> >>>> >>>>>The attached patch fixes a problem in gdb when a corefile is read in >>>>>after a multithreaded application has been debugged. What happens is >>>>>that >>>>>the thread-db and lin-lwp layers are still around and run into internal >>>>>errors. >>>>> >>>>>The solution is simply to unpush the thread-db ops in its mourn_inferior >>>>>routine. If a corefile gets loaded, there is no thread-db to interfere. >>>>>If another multi-threaded app gets loaded, the thread_db_new_objfile is >>>>>designed to bring back the thread-db layer as needed. >>>>> >>>>>This fix solves another failure in the killed.exp testsuite as well. >>>>> >>>>>Ok to commit? >>>> >>>>Sorry, no. AFAICT this will break debugging programs that are >>>>statically linked against libpthread. As a minimum, this code should >>>>check keep_thread_db before unpushing the target, but even then, I'm >>>>not sure whether this is really OK. >>> >>> >>>Programs statically linked against libpthread are already broken. I >>>have a patch to fix it, but it's so gross that I haven't posted it; I >>>still can't think of a good way to do it. >>> >>>Given the way GDB treats targets, we seem to be waffling; someone fixes >>>core file support and breaks static binaries, or vice versa. >>> >> >>So, is there a scenario where my patch would be wrong? I am seeing what you >>discussed. Statically linked multi-threaded programs don't work with gdb >>because we never set up the thread_db_ops layer to begin with >>(thread_db_new_objfile never gets called with a non-null objfile with >>the target_has_execution flag on). > > > I don't know. The whole way in which thread_db is initialized right > now is a little bit confusing. > Mark, I haven't seen a response from you regarding this. Do you still oppose the patch now that it is clear that statically linked threaded programs never worked in the first place? If so, could you please elaborate. -- Jefff J.