From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21489 invoked by alias); 6 Oct 2011 20:26:05 -0000 Received: (qmail 21474 invoked by uid 22791); 6 Oct 2011 20:26:03 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,TW_BJ X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 06 Oct 2011 20:25:49 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1RBuVo-0000cL-UO from pedro_alves@mentor.com ; Thu, 06 Oct 2011 13:25:49 -0700 Received: from scottsdale.localnet ([172.16.63.104]) by EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 6 Oct 2011 21:25:47 +0100 From: Pedro Alves To: Doug Evans Subject: Re: [RFA] Only try to load libthread_db when we load libpthread. Date: Thu, 06 Oct 2011 20:26:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-11-generic; KDE/4.7.1; x86_64; ; ) Cc: gdb-patches@sourceware.org References: <20111005182705.D744E2461D1@ruffy.mtv.corp.google.com> <201110062056.25790.pedro@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201110062125.36925.pedro@codesourcery.com> X-IsSubscribed: yes 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 X-SW-Source: 2011-10/txt/msg00182.txt.bz2 On Thursday 06 October 2011 21:08:08, Doug Evans wrote: > On Thu, Oct 6, 2011 at 12:56 PM, Pedro Alves wrote: > > > > On Thursday 06 October 2011 12:22:24, Pedro Alves wrote: > > > On Wednesday 05 October 2011 19:27:05, Doug Evans wrote: > > > > 2011-10-05 Doug Evans > > > > > > > > * linux-thread-db.c (thread_db_new_objfile): Only try to load > > > > libthread_db when we load libpthread. > > > > > > Makes sense to me. > > > > > > > No regressions in amd64-linux, > > > > but I can imagine it misses some cases. > > > > > > Yeah. I think we'll no longer activate thread_db when debugging core > > > files of static executables (e.g., a core of gdb.threads/staticthreads). > > > It works with live debugging since we call check_for_thread_db > > > from linux_child_post_attach/linux_child_post_startup_inferior. > > > Maybe moving that to an inferior_created observer in > > > linux-thread-db.c would work. > > > > And all the talk about executables made me realize something else. :-) > > > > For static threaded executables, we'll want to check for thread > > db when the symbols of the main executable are (re)loaded too. > > I don't recall off hand if there's a flag in the objfile to > > know that it's from the main executable though. > > In what scenario? > [what would the user type?] (gdb) file wrong_executable (gdb) attach PID or core-file core.1234 whooops! (gdb) file right_executable -- Pedro Alves