From patchwork Fri Aug 21 21:23:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 8372 Received: (qmail 117778 invoked by alias); 21 Aug 2015 21:23:27 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 117702 invoked by uid 89); 21 Aug 2015 21:23:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=no version=3.3.2 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 21 Aug 2015 21:23:24 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id B554591E9D for ; Fri, 21 Aug 2015 21:23:23 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-22.ams2.redhat.com [10.36.116.22]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t7LLNLEE019767 for ; Fri, 21 Aug 2015 17:23:22 -0400 Subject: [PATCH v12 24/32] solib_find: Search also by build-id From: Jan Kratochvil To: gdb-patches@sourceware.org Date: Fri, 21 Aug 2015 23:23:21 +0200 Message-ID: <20150821212321.6673.63163.stgit@host1.jankratochvil.net> In-Reply-To: <20150821212006.6673.35100.stgit@host1.jankratochvil.net> References: <20150821212006.6673.35100.stgit@host1.jankratochvil.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-IsSubscribed: yes Hi, solib_find() can now try to search also by build-id. Jan gdb/ChangeLog 2015-08-20 Jan Kratochvil * solib.c: Include build-id.h. (solib_find_3): Call build_id_to_file. --- 0 files changed diff --git a/gdb/solib.c b/gdb/solib.c index b044e72..a425e4d 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -47,6 +47,7 @@ #include "gdb_bfd.h" #include "filestuff.h" #include "source.h" +#include "build-id.h" /* Architecture-specific operations. */ @@ -313,6 +314,17 @@ solib_find_3 (char *in_pathname, enum openp_flags opts, int is_solib, /* We try to find the library in various ways. */ + if (build_idsz != 0) + { + file = build_id_to_file (build_idsz, build_id, "", opts); + if (file_location_is_valid (&file)) + { + do_cleanups (old_chain); + return file; + } + file_location_free (&file); + } + /* If the search in gdb_sysroot failed, and the path name is absolute at this point, make it relative. (openp will try and open the file according to its absolute path otherwise, which is not what we want.)