From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5419 invoked by alias); 7 Jul 2017 18:20:37 -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 5403 invoked by uid 89); 7 Jul 2017 18:20:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy= X-HELO: camailhost.cavium.com Received: from camailhost.cavium.com (HELO camailhost.cavium.com) (12.108.191.230) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 07 Jul 2017 18:20:35 +0000 Received: from sellcey-dt.caveonetworks.com ([10.18.104.136]) by camailhost.cavium.com (8.14.7/8.14.7) with ESMTP id v67IKYTP032227 for ; Fri, 7 Jul 2017 11:20:34 -0700 Received: from sellcey-dt.caveonetworks.com (localhost [127.0.0.1]) by sellcey-dt.caveonetworks.com (8.15.2/8.15.2/Debian-3) with ESMTP id v67IKXJA017200 for ; Fri, 7 Jul 2017 11:20:33 -0700 Received: (from sellcey@localhost) by sellcey-dt.caveonetworks.com (8.15.2/8.15.2/Submit) id v67IKXSr017199; Fri, 7 Jul 2017 11:20:33 -0700 Date: Fri, 07 Jul 2017 18:20:00 -0000 From: Steve Ellcey Message-Id: <201707071820.v67IKXSr017199@sellcey-dt.caveonetworks.com> To: gdb@sourceware.org Subject: gdb / thread_db / multiple ABI question Reply-To: sellcey@cavium.com X-SW-Source: 2017-07/txt/msg00005.txt.bz2 I have a question about debugging, the thread_db library, and multiple ABI's. I am trying to support an ILP32 ABI to the aarch64 architecture. Now I am still building gdb as a LP64 object. In most cases this seems fine, I can use an LP64 gdb to debug an ILP32 object. But when I have threaded objects and need to use libthread_db.so, things don't seem to work. When I try this and set libthread_db_debug to 1, I get: Trying host libthread_db library: /home/sellcey/gdb-ilp32/install/libilp32/libth read_db.so.1. dlopen failed: /home/sellcey/gdb-ilp32/install/libilp32/libthread_db.so.1: wrong ELF class: ELFCLASS32. thread_db_load_search returning 0 warning: Unable to find libthread_db matching inferior's thread library, thread debugging will not be available. 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? 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. Steve Ellcey sellcey@cavium.com