From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 50957 invoked by alias); 25 Aug 2015 18:14:29 -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 50938 invoked by uid 89); 25 Aug 2015 18:14:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-vk0-f50.google.com Received: from mail-vk0-f50.google.com (HELO mail-vk0-f50.google.com) (209.85.213.50) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 25 Aug 2015 18:14:26 +0000 Received: by vkd66 with SMTP id 66so77462399vkd.0 for ; Tue, 25 Aug 2015 11:14:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=zeLnNKIeDooU0jIhKVjnttC+vrlDJZ8hrlWUfDizD34=; b=VqJbO5hjQb1Y+NUN/IkJ4tEMi+bMULMuD/mZWEX5DpZDm9xDklOuNcliDFt+Mlvj8J P+2M0UnSGfJQafJ46L1ZiYcw8cp1BYh51sbQ6QNAELOkBJwyTWRvChh0LRE1xY0jR6za bRQTUOkRk+mDtBFCyHtw04UogX+jJPjlV0D0gWF6FQpx7BdFgb3IhhRvidkQ2ACuxs/b rWAg8BhAHRCntJVB6e3LA3Jq16xIxci1tpQw8w0KDRAMVV5IL1y62LxGzI15480/oy18 lsXQp87NCK6etbC77l8GtgAlbkDtaWSpgdn/h5Cqmi5ufMp9UO2+h8JBPYluih1fGIw/ TvYg== X-Gm-Message-State: ALoCoQlymCd0FHt7yZFr4pCv2C+4kuJFzUfFs1lTtwy8E7x6/It0lu6YI/FXicG0/acNJPaKC1hL X-Received: by 10.52.94.42 with SMTP id cz10mr38426111vdb.22.1440526463888; Tue, 25 Aug 2015 11:14:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.222.194 with HTTP; Tue, 25 Aug 2015 11:13:54 -0700 (PDT) In-Reply-To: <20150825180100.GA30888@host1.jankratochvil.net> References: <20090406203920.CCD6F19C4EC@localhost> <20150825180100.GA30888@host1.jankratochvil.net> From: Paul Pluzhnikov Date: Tue, 25 Aug 2015 18:14:00 -0000 Message-ID: Subject: Re: [patch][rfc] Allow GDB to search for the right libthread_db.so.1 To: Jan Kratochvil Cc: gdb-patches ml Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00731.txt.bz2 On Tue, Aug 25, 2015 at 11:01 AM, Jan Kratochvil wrote: > On Mon, 06 Apr 2009 22:39:20 +0200, Paul Pluzhnikov wrote: >> We have perhaps uncommon setup here, where we have several installed >> versions of glibc, and need to debug executables which are compiled >> and linked against them (using -rpath). >> >> Currently, GDB will dlopen("libthread_db.so.1", ...), which means that >> in order debug "non-standard" binary, one has to set LD_LIBRARY_PATH to >> point to correct libthread_db before invoking GDB, or it will refuse to >> see threads in the inferior. This is not automatic, and error prone. > > Just out of curiosity: > > libthread_db should be compatible with any libpthread thanks to: > > $ nm /lib64/libpthread.so.0|grep _thread_db_ > 0000003d1b812010 r _thread_db_dtv_dtv > 0000003d1b812004 r _thread_db_dtv_t_pointer_val > 0000003d1b81201c r _thread_db_link_map_l_tls_modid > 0000003d1b8120c4 r _thread_db_list_t_next > 0000003d1b8120b8 r _thread_db_list_t_prev > [39 lines total] I don't understand what above symbols do, but ... We've had a lot of systems where installed /lib64/libthread_db was from glibc-2.7, while target binary was using glibc-2.3.6, and I am 99.99% sure that combination didn't work. Currently we have most systems using glibc-2.19 in both /lib64 and target, but when transitioning between OS releases (upgrading desktops) we frequently have system libthread_db being older than target libc. Also, fully-static links are used sometimes, and that often presents its own challenges. > Do you use non-glibc libthread_db/libpthread (Bionic?) or this _thread_db_* > compatibility API does not work even for glibc versions? We do not use non-glibc libthread_db/libpthread. Cheers, -- Paul Pluzhnikov