From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 69392 invoked by alias); 7 Jul 2017 18:36:53 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 69003 invoked by uid 89); 7 Jul 2017 18:36:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=sk:solibs, libthread_db, debugged, sk:libthre 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; Fri, 07 Jul 2017 18:36:51 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DADFD7F411; Fri, 7 Jul 2017 18:36:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com DADFD7F411 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=palves@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com DADFD7F411 Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C13777BE2; Fri, 7 Jul 2017 18:36:49 +0000 (UTC) Subject: Re: gdb / thread_db / multiple ABI question To: sellcey@cavium.com, gdb@sourceware.org References: <201707071820.v67IKXSr017199@sellcey-dt.caveonetworks.com> From: Pedro Alves Message-ID: <306e2da9-4fea-76a2-e130-f6661f9826e8@redhat.com> Date: Fri, 07 Jul 2017 18:36:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <201707071820.v67IKXSr017199@sellcey-dt.caveonetworks.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-07/txt/msg00006.txt.bz2 On 07/07/2017 07:20 PM, Steve Ellcey wrote: > It makes sense that the LP64 gdb cannot dlopen the ILP32 thread_db that > corresponds to the ILP32 thread library that the program being debugged > uses but I don't know what to do about it. > > I looked at x86 and when I compile a 32 bit program there and then debug > it with a 64 bit gdb I see: > > [Thread debugging using libthread_db enabled] > Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". > > So I am guessing that aarch64 needs to use the 64 bit libthread_db.so.1 even > when debugging 32 bit programs, is that right? Yes. Though I have no idea whether an Aarch64 build of libthread_db is capable of biarch debugging. It may be that GDB is already trying to the load the 64-bit libthread_db, but then libthread_db rejects the inferior for some reason. The "set debug libthread-db" option should help you figure that out. See below. > What do I need to do to tell > gdb to do that? I tried adding /home/sellcey/gdb-ilp32/install/lib64 to > solib-search-path but that did not help. I am not sure what triggers the > difference in behaviour between aarch64 and x86. See: (gdb) apropos libthread info auto-load libthread-db -- Print the list of loaded inferior specific libthread_db set auto-load libthread-db -- Enable or disable auto-loading of inferior specific libthread_db set debug libthread-db -- Set libthread-db debugging set libthread-db-search-path -- Set search path for libthread_db show auto-load libthread-db -- Show whether auto-loading inferior specific libthread_db is enabled show debug libthread-db -- Show libthread-db debugging show libthread-db-search-path -- Show the current search path or libthread_db The related GDB code is in gdb/linux-thread-db.c. Thanks, Pedro Alves